









































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










































1. What is Data? a. Data is a collection of raw, unorganized facts and details like text, observations, figures, symbols, and descriptions of things etc. In other words, data does not carry any specific purpose and has no significance by itself. Moreover, data is measured in terms of bits and bytes – which are basic units of information in the context of computer storage and processing. b. Data can be recorded and doesn’t have any meaning unless processed. 2. Types of Data a. Quantitative i. Numerical form ii. Weight, volume, cost of an item. b. Qualitative i. Descriptive, but not numerical. ii. Name, gender, hair color of a person.
CodeHelp
8. DBMS vs File Systems a. File-processing systems has major disadvantages. i. Data Redundancy and inconsistency ii. Difficulty in accessing data iii. Data isolation iv. Integrity problems v. Atomicity problems vi. Concurrent-access anomalies vii. Security problems b. Above 7 are also the Advantages of DBMS (answer to “ Why to use DBMS? ”)
CodeHelp
b. The overall design of the DB is called the DB schema. c. Schema is structural description of data. Schema doesn’t change frequently. Data may change frequently. d. DB schema corresponds to the variable declarations (along with type) in a program. e. We have 3 types of Schemas : Physical, Logical , several view schemas called subschemas. f. Logical schema is most important in terms of its effect on application programs, as programmers construct apps by using logical schema. g. Physical data independence , physical schema change should not affect logical schema/application programs.
3. Data Models: a. Provides a way to describe the design of a DB at logical level. b. Underlying the structure of the DB is the Data Model; a collection of conceptual tools for describing data, data relationships, data semantics & consistency constraints. c. E.g., ER model, Relational Model, object-oriented model, object-relational data model etc.
CodeHelp
b. T2 Architecture i. App is partitioned into 2-components. ii. Client machine, which invokes DB system functionality at server end through query language statements. iii. API standards like ODBC & JDBC are used to interact between client and server. c. T3 Architecture i. App is partitioned into 3 logical components. ii. Client machine is just a frontend and doesn’t contain any direct DB calls. iii. Client machine communicates with App server, and App server communicated with DB system to access data. iv. Business logic, what action to take at that condition is in App server itself. v. T3 architecture are best for WWW Applications. vi. Advantages :
CodeHelp
5. Referential Constraints 1. Specified between two relations & helps maintain consistency among tuples of two relations. 2. It requires that the value appearing in specified attributes of any tuple in referencing relation also appear in the specified attributes of at least one tuple in the referenced relation. 3. If FK in referencing table refers to PK of referenced table then every value of the FK in referencing table must be NULL or available in referenced table. 4. FK must have the matching PK for its each value in the parent table or it must be NULL.
SQL DATA TYPES (Ref: https://www.w3schools.com/sql/sql_datatypes.asp)
DATATYPE Description
CHAR string(0-255), string with size = (0, 255], e.g., CHAR(251) VARCHAR string(0-255)
TINYTEXT String(0-255)
TEXT string(0-65535)
BLOB string(0-65535)
MEDIUMTEXT string(0-16777215)
MEDIUMBLOB string(0-16777215)
LONGTEXT string(0-4294967295)
LONGBLOB string(0-4294967295)
TINYINT integer(-128 to 127)
SMALLINT integer(-32768 to 32767)
MEDIUMINT integer(-8388608 to 8388607)
INT integer(-2147483648 to 2147483647)
BIGINT integer (-9223372036854775808 to
FLOAT Decimal with precision to 23 digits
DOUBLE Decimal with 24 to 53 digits
DATATYPE
CONSTRAINTS (DDL)
FOREIGN KEY(cust_id) REFERENCES customer(id) ON DELETE CASCADE );
JOINING TABLES
SET OPERATIONS
SUB QUERIES
JOIN SET Operations
Combines multiple tables based on matching condition.
Combination is resulting set from two or more SELECT statements. Column wise combination. Row wise combination.
Data types of two tables can be different. Datatypes of corresponding columns from each table should be the same. Can generate both distinct or duplicate rows. Generate distinct rows.
The number of column(s) selected may or may not be the same from each table.
The number of column(s) selected must be the same from each table. Combines results horizontally. Combines results vertically.