




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Q & A Practical practice Computer science
Typology: Exams
1 / 170
This page cannot be seen from the preview
Don't miss anything!





























































































1.1 Overview Q : 01-01-01 : Define Data, Information and Explain Operations on Data? Answer : Data : Data is a collection of facts, figures and statistics - related to an object, that can be processed to produce a meaningful information. Information : The manipulated and processed data is called information e.g., the percentage of students results. It is an output of a certain process. Operations : Manipulation of data (after capturing from different sources) to achieve the required objectives and results. For this purpose, a software (program) is used to process raw data which is converted to meaningful information. These are categorized into three basic activities : Data Capturing : Data must be recorded or captured in some form before it can be processed. Data Manipulation : The following operations may then be performed on the gathered data. Classifying : Organizing data into classes /groups. Items may be assigned predetermined codes, they can be numeric, alphabetic or alphanumeric. Calculations : Arithmetic manipulation of the data. Sorting : Data is arranged in logical sequence (numerically or alphabetically). Summarizing : Masses of data are reduced to a more concise and usable form. Managing The Output Results : Once the data is captured & manipulated it may be : Storing and Retrieval : Data is retained for future reference. Accessing / fetching the stored data and / or information is the Retrieve Activity. Communication and Reproduction : Data may be transferred from one location or operation to another, for further processing. It is sometimes necessary to copy or to make duplicate of data, called Reproduction. 1.2 Traditional File System Q : 01-02-01 : Define and Explain Record and File?
Answer : Record : A collection of related fields (facts about something) treated as a single unit is called a record. Let us see one student’s biographic information (record) : Roll Number 13- Student Name Muhammad Saleem Class XI File : A collection of related records treated as a single unit is called a file or a data set. Records of all the students together, make a file. Q : 01-02-02 : Explain Types of File from Usage Point of View? Answer : Master File : These are the latest updated files which never become empty, ever since they are created. They maintain information that remains constant over a long period of time. Transaction File : Files in which data prior to the stage of processing is recorded. It may be temporary file, retained till the master file is updated. Backup File : Permanent files, for the purpose of protection of vital data. Q : 01-02-03 : Explain Types of File from Functional Point of View ? Answer : Program Files : These files contain the software instructions i.e. source program files and executable files. The source program files may have the extension as .cpp and the executable files as .exe. Data Files : These files contain data and are created by the software being used. A few of these are : Word Processor .doc, .rtf (document), Spread Sheet .xls and .wks (worksheet), Video files .avi, .mpg etc. Q : 01-02-04 : Explain Types of File from Storage (File Organization) Point of View? Answer : File Organization (Storage Point of View) : Sequential Files : Files are stored or created on the storage media in the order the records are entered i.e., one after another in the sequence. Direct or Random Files : These files reside on the storage media according to the address which is calculated against the value of the key field of the record. Indexed Sequential : The key field of the records (in a file) are stored separately along with the address of each record. These require relatively more space on the storage media but the processing is as fast as random / direct files. 1.3 Databases Q : 01-03-01 : Define & Explain Database? Answer :
Network Model : Similar to Hierarchical model but subordinate entities, depicted by arrows on the network diagram, may participate in as many subordinate relationships as desired. Relational Model : Collection of simple files/Relations (Entities), each of which has no structural or physical connection like hierarchical or network systems. The various entities possess the interrelationships as depicted by a network like diagram but these relationships are based on the data content of the entities involved. 1.4 Database Management System Q : 01-03-03 : Describe Database Management System (DBMS) and state Objectives of DBMS? Answer : Database Management System (DBMS) : The data management system (a collection of programs) which is used for storing and manipulating databases is called database management system (DBMS). DBMS software (database manager) controls the overall structure of a database and access to the data itself. Objectives of Database Management System (DBMS) : Share Ability : Different people and processes must be able to use the same data at the same time. Availability : Both the data and DBMS must be easily accessible to the users. Evolvability : The ability of the DBMS to change in response to growing user needs and advancing technology. Database Integrity : Since data is shared among multiple users, adequate integrity control measures must be maintained. Q : 01-03-03 : Describe Advantages of Database Management System (DBMS)? Answer : Advantages of Database Systems :
Data Independence : Application programs are not aware of the physical implementation of the data sets. The DBMS sits in between the application programs and the actual data sets that make up the database. Support Complex Data Relationships : Fairly complex structures can be designed which allow various ways to logically access the data. Sophisticated Data Security Features : Provide enhanced security mechanisms for access to data. Data base security mechanisms typically go much further in adding more extensive security features. Data Base Backup / Recovery : Provide sophisticated backup / recovery mechanism. Backup / Recovery capabilities often distinguish between true DBMS and a software package that only claims this facility. Advanced Capabilities : DBMS normally have advance access capability for on-line and ad-hoc reporting capabilities. Q : 01-03-03 : Describe Disadvantages of Database Management System (DBMS)? Answer : Disadvantages of Database Systems : Require additional System Overhead : Additional overhead is required to access data, in case of doing some simple jobs; like reading and processing a tape file, which might take a little time and resources to do the job. If we have to do it on DBMS, it is like “requiring too much to do too little”. Additional Training Required for Training of Staff : Application programmers require a sort of precise training to code efficient programs that will run under a DBMS. Problems can multiply in selecting a wrong type of Database Environment : A later change in structure, forced by changing requirements, can be costly in terms of conversion and testing of existing programs. Data must be considered a Corporate Resource : The data in a company’s database no longer belong to one organization alone. One organization normally has the primary responsibility for creating a database, many can share the same data across applications. A Need of a Dictionary : To share data across application systems, the internal data contents of a company’s databases need to be documented in a consistent manner, thus another overhead on the DBMS. Q : 01-03-03 : Describe Features of Database Management System (DBMS)? Answer : Features of a DBMS : Data Dictionary : Some databases have a data dictionary, a procedures document or disk file that stores the data definitions or a description of the structure of data used in the database. The data dictionary may monitor the data being entered to make sure it conforms to the data definition rules i.e., file names, field names, field sizes, data types etc. It may be used for data access authorization for the database users. Utilities : The DBMS utilities are the sofiware programs that are used to maintain the database
2.1 Overview Q : 02-01-01 : Define Field, Record and File? Answer : Field : A field is a unit of data consisting of one or more characters i.e., Roll Number, Student Name, Grade etc. Record : A collection of related data items treated as a single unit is called a record. File : A collection of related records treated as a single unit is called a file or a data set. 2.2 Attributes, Rows and Tables Q : 02-02-01 : Define Data Elements, Records, Files or Datasets and Databases? Answer : Data Elements : The fields or data items in databases are termed as data items, items, attributes or columns in database structures. Records : Records in file management structures are termed as rows or tuples in database structures. Files or Datasets : Files or Datasets in databases are termed as tables relations or data objects in database structures. Database : The collection of tables with some traditional files and some other necessary data objects is termed as a database. 2.3 Relation or Table Q : 02-03-01 : Define Relation or Table and describe Entity? Answer : Relation or Table : A two dimensional array or table of data containing descriptive information about an entity. The entity must have a unique identifier, which is composed of a combination of one or more attributes, and each attribute must have one and only one value. It is appropriate to define the word Entity here. Entity : An entity is any thing about which you want to keep information in the database: Let us consider an example of “Student Information System”, which has entities like student, teacher, course list, scholarships, time-tabling. Thus, the entities involved in this case are the same and the entity “student” can be defined in the form of database modeling : STUDENT (STUDENT_NO, STUDENT_NAME, STUDENT_GENDER_CD, STUDENT_BIRTH_DATE, STUDENT_ADDRESS, STUDENT_TEL_NO)
From the above given definition of entity, we can easily construct a two- dimensional array or a relation by converting all the attributes in the brackets into columns of the array. Q : 02-03-02 : Describe Properties of Relation? Answer : Properties of Relation : A Relation or a Table which is the basis of a Relational DBMS, by definition must have certain inherent characteristics that form the basic for its underlying strength and flexibility. Because of these features, an application implemented by using such a system is much more flexible and can be easily modified when alterations or enhancements to the underlying data base take place. These characteristics are : No Duplicate Rows Exist : No two rows can be identical. Why to put two rows (records) for the same entity (i.e. person). It will also violate the definition of what a relation represents, as it says by definition that their must be a unique key for each row in a relation / table. The Order of Rows is Insignificant : There is no ordering or sequencing of the rows in the tables. The relational implementation of the tables support all required access mechanism i.e., it is not necessary to sequence the rows according to the key field. The Order of Columns is Insignificant : Again, the order of the columns/attributes in defining a relation/table has no significance. The later insertions of the columns are made at end of the existing columns by the system itself. The system acquires the data (of columns) by their names. Columns / Attributes are all Elemental or Atomic : All the intersections of Rows and Columns must have a nulls are inserted by the system at the time of column, which should immediately be replaced by zeros / spaces valid values for that particular column. 2.4 Views Q : 02-04-01 : Describe Views? Answer : Views : Views are created by using SQL, which is a powerful database language, used for data definition and data manipulation purposes. The purpose of using views is purely to keep the data safe and secure from un-authorized and illegal users. The views provide the descriptions of relations that are not stored, but constructed as needed from stored relations. To create a view, normally the following CREATE SQL command is used : CREATE VIEW STUDENT_VIEW_01 AS SELECT STUDENT_ADDRESS
2.7 The User Q : 02-07-01 : Define User? Answer : User : The user or end-user is simply a person who uses the computers for his specific need. He might have a moderate knowledge of computers, computer science and information technology, and his need to use the computers may be entertainment, education, or professional tasks. He does not need to know the in-depth knowledge of the computer systems, but instead, he should be aware of the installed software he intends to use. 2.8 The Data Administrator Q : 02-08-01 : Define The Data Administrator? Answer : The Data Administrator : A data administrator (DA) is responsible for the entire data of an organization. He normally develops the overall functional requirements for the databases being used m the office. He shares in developing the logical design for each database. He should control and manage the databases, establish the data standards, supervise the data distribution within the organization and communicate with the users when necessary. He should also participate in developing the data dictionary, prepare documentation and conduct user training where needed. Normally, the Data Administrator serves as a bridge between users and data processing staff. 2.9 The Database Administrator Q : 02-09-01 : Define The Database Administrator? Answer : The Database Administrator (DBA) : A database administrator (DBA) is responsible for the design, implementation, operation, management and maintenance of the database. He / She must be technically expert on the overall intricacies of the database and DBMS. He is supposed to plan, coordinate and carry out a variety of jobs during all phases of the database projects. He must possess the technical skills because he has to work on the complex software and hardware issues involved and to solve the problems of the system and application experts in the organization. He is also responsible to make sure the database access rights, to safeguard its security and to maintain and fine-tune the database functionality.
3.1 Overview Q : 03-01-01 : Define Feasibility Study, Requirements Analysis, Project Planning and Data Analysis?
Answer : Feasibility Study : This is also called preliminary investigation of the required database. It involves the area identification and selection i.e. which area or aspect is to be selected to start with. After the project is selected, it is allocated a specific find and a proper planning is chalked out for its practical implementation. Side by side, a proper market analysis is also worked out. Requirements Analysis : During this activity, the requirements are gathered i.e. the possible inputs for the database and the required functionality out of it. The users precisely narrate their needs of the database and the possible domain and restrictions are also chalked out. Project Planning : A proper schedule is laid down to accomplish this activity. All the cost factors are taken into consideration i.e., the salaries of team members, theft logistics involved, other trivial expenses (such as marriage gifts, insurances etc) and hardware costs. Data Analysis : This is an important analysis aspect while designing a database. It involves : Data Flow Diagrams (DFD) Decision Tables Decision Trees 3.2 Data Modeling Q : 03-02-01 : Describe Ingredients of Data Modeling? Q : 03-02-01 : Describe Entities / Objects, Attributes , Relationships, Cardinality, Modality and ERD (Entity Relationship Diagram)? Answer : Ingredients of Data Modeling : Entities / Objects : [A data entity / object is anything that is participating in the system. It is always properly identifiable] i.e., a TEACHER, a STUDENT, an AEROPLANE. Attributes : [Attributes define the objects, describe their characteristics and in some cases, make references to other objects(s)] i.e., attributes for a TEACHER could be: Teacher Name, Gender, Last Degree, Appointment Date, Pay Scale, Nationality, Telephone No. etc. Relationships : [The relationship indicates how the Entities/Objects are Connected or Related to each other]. The Data objects are related / connected to one another in different ways. Important to note are : All the relationships define the relevant connections between both objects. All the relationships are bi-directional. We have to consider only the relevant relationship (in the context of the requirement). Cardinality : Whether some occurrence(s) of object-1 are related to some occurrence(s) of object-2. It is expressed as one or many. A relationships can be One to One, One to Many, Many to Many, Recursive and None. Modality : It defines the nature of the relationship :
3.3 Database Design Q : 03-03-01 : Describe major objective of Database Design? Explain Database Development process with diagram? Answer : Major Objective of Database Design : [To map the conceptual data model to an implementation model that a particular DBMS can process with performance that is acceptable to all users throughout the organization]. Today, database users require information that is complete and up-to-date and they expect to be able to access this information quickly and easily. The Database Development process in diagram :
Q : 03-03-02 : Explain Conceptual (Logical) Database Design? Answer : Conceptual (Logical) Database Design : [The process of mapping the conceptual data models (from analysis) to structures that are specific to the target DBMS]. If the target environment is a relational DBMS, then the conceptual data models are mapped to normalized relations. Diagram below presents an overview of logical design process : Conceptual Data Model (E-R Diagram)
Q : 03-03-03 : Explain Physical Database Design? Answer : Physical Database Design : [To implement the database as a set of stored records, files, indexes and other data structures that will provide adequate performance and ensure database integrity, security and recoverability]. There are three major inputs to Physical database design : Logical Database Structures : Developed during logical database design i.e., the Normalized Relations. User Processing Requirements : The size and frequency of use of the DataBase, response time, security, backup, recovery etc. Characteristics of the DBMS and other components of the computer Operating environment. Q : 03-03-04 : Explain Components of Physical Database Design? Answer : Components of Physical Database Design : Data Volume and Usage Analysis : To estimate the size or volume and the usage patterns of the database. Estimates of database size are used to select Physical storage devices and estimate the costs of storage. Estimates of usage paths or patterns are used to select the file organization and access methods, to plan for the use of indexes and to plan a strategy for data distribution. Data Distribution Strategy : Many organizations today have distributed computing networks. For these organizations, a significant problem in physical database design is deciding at which nodes (or sites) in the network to physically locate the data. Basic data Distribution Strategies are : Centralized : All data are located at a single site. It is fairly easy to do but it has at least three disadvantages : Data are not readily accessible at remote sites. Data communication costs may be high. The database system fails totally when the central system fails. Partitioned : The database is divided into partitions (fragments). Each partition is assigned to a particular site. Major advantage of this is that data is moved closer to local users and so is more accessable. Replicated : Full copy of database is assigned to more than one site in the network. This approach maximizes local access but creates update problems, since each database change must be reliably processed and synchronized at all of the sites. Hybrid : In this strategy, the database is partitioned into critical and non-critical fragments. Non-critical fragments are stored at only one site, while critical fragments are stored at multiple sites. File Organization : A technique for physically arranging the records of a file on secondary storage devices. For selecting a file organization, the system designer must recognize several constraints, including the physical characteristics of the secondary storage devices, available operating systems and file management software, and user
needs for storing and accessing data. Following is the criteria for selecting file organizations : Fact access for retrieval. High throughput for processing transactions. Efficient use of storage space. Protection from failure or data loss. Minimizing need for re-organization. Accommodating growth. Security from un-authorized use. Indexes : An index is a table that is used to determine the location of rows in a table ( or tables) that satis1’ some condition. They may be created on primary key, secondary key, foreign key etc. Integrity Constraints : Database integrity refers to the correctness and consistency of data. It is another form of database protection. While it is related to security and precision, it has some broader implications. Security involves protecting the data from unauthorized operations, while integrity is concerned with the quality of data itself Integrity is usually expressed in terms of certain constraints which are the consistency rules that the database is not permitted to violate. 3.4 Implementation Q : 03-04-01 : Explain Database Implementation Phase? Answer : Database Implementation Phase : The builder or the database administrator normally requires a server computer which will be linked with hundreds and thousands of computer users who would want to share and interact with the server (database). For this purpose, the DBA might need the services of network administrators to connect the users with the server. The users are normally given the authorizations / permissions defined by their respective managers so that they can perform the authorized tasks while using the database facilities. In distributed computing environment, the database servers and users might be thousands of kilometers apart, so a lot of expensive telecommunication links are required to perform the designated tasks. NADRA and CRICKINFO are some of the typical examples of this type of databases.
4.1 Overview Q : 04-01-01 : Explain Data Integrity? Answer : Data Integrity : Database integrity refers to the correctness and consistency of data. It is another form of database protection. While it is related to security and precision, it has some broader implications as well. Security involves protecting the data from unauthorized operations, while integrity is concerned with the quality of data itself.
Q : 04-01-03 : Define Normalization and Normal Form? Explain First Normal Form (1 NF)? Answer : Normalization : [It is the process of converting complex data structures into simple and stable data structures. It is based on the analysis of functional dependence]. [Normalization is a technique for reviewing the entity / attribute lists to ensure that attributes are stored “where they belong to”. It is the basis for a relational data base system]. Normal Form : A Normal Form is a state of a relation that can be determined by applying simple rules, regarding dependencies (or relationship between attributes), to that relation. First Normal Form (1 NF) : “A relation R is in First Normal Form if and only if all underlying domains contain atomic values only”. Relation : The Pre-Requisite is that “A relation has always a primary key associated with it”. Unique Identification Key : All entities must have a key, composed of a combination of one or more attributes which uniquely identify one occurrence of the entity. No Repeating Groups : For any single occurrence of an entity, each attribute must have one and only one value or “An attribute must have no REPEATING GROUPS”. Step-1 : Whenever repeating groups occur, the repeating Attribute must be removed and placed “Where it Belongs”, under the entity that it describes. Step-2 : Next, study the relationship of where the Repeating attribute came
from, and where the Attribute went to. Determine if the From-To Relationship is 1:M or M:N. Q : 04-01-04 : Explain Second Normal Form (2 NF)? Answer : Second Normal Form (2 NF) : [A relation is in second normal form NF (2 NF) if it is in 1 NF and every non-key attribute is fully functionally dependent on the primary key]. Second Definition : “To be in 2 NF, every non-key attribute must depend on the key and all parts of the key”. Necessary & Sufficient Conditions : A table (relation) will be in 2NF if any of the following conditions apply : The primary key consists of only one attribute. No non-key attributes exist in the relation. Every non-key attribute is functionally dependant on the full set of primary key attributes. Consider table STUDENT in shorthand notation : STUDENT(STUD-ID,NAME,DEPT,MONFEE,CRSNO,CDTE) The functional dependencies in this relation are the as follows : STUD-ID NAME, DEPT, MONFEE STUD-ID,CRSNO CDTE The primary key in ii above is the composite key : STUD-ID + CRSNO. Therefore, the non-key attributes NAME,DEPT and MONFEE are functionally dependent on part of the primary key (STUD-ID) but not on CRSNO. Partial Functional Dependency : [A partial functional dependency exists when one or more non-key attributes (such as NAME) are functionally dependant on part (but not all) of the primary key]. Anomalies : The partial functional dependency creates redundancy in the table, which results in certain anomalies when the table is updated : Insertion Anomaly : To insert a row for the table, we must provide the values for both STUDENT-ID (Primary Key) and COURSE-NO (Not Primary Key).