You are on page 1of 5

SQL 01

1) Objectives of SQL:
a. create the database and relation structures.
b. perform insertion, modification, deletion of data from relations.
c. perform simple and complex queries.
d. Must perform these tasks with minimal user effort.
e. It must be portable.
2) Why SQL:
a. Easy to learn.
b. Non-Procedural: you specify what information you require, rather than how to get it
c. Essential free format
3) Capabilities of SQL:
a. Retrieve data from database.
b. Selection and projection of data into Table
4) Components of SQL:
a. Data Definition Language (DDL)
b. Data Manipulation Language (DML)
c. Data Control Language (DCL)
d. Integrity and transaction control
e. Views
f. Catalog and dictionary facility.
5) Database Objects
a. TABLE:
b. VIEW: Logically represents subsets of data from one or more tables.
c. SEQUENCE: generate primary key values
d. INDEX: Improve the performance of some queries.
e. SYNONYM: Gives alternative names to objects.
6) Create and Drop schema
7) Create table: CREATE TABLE [schema.] table
8) Alter Table
9) Adding a Column
10) Modifying a column: ALTER TABLE dept30

MODIFY (ename Varchar2 (15));

11) Changing the name of an object: SQL> RENAME dept TO my_department;


12) Dropping a table: SQL> DROP TABLE dept30;
13) Truncating a Table: Removes all rows from a table & Releases the storage space used by that
table {SQL>TRUNCATE TABLE dept;}
14) Adding Constraints: rules at the table level. It prevents the deletion of table if there are
dependencies.
a. Not Null: Ensures that null values are not permitted for the column.
b. Unique: All values will be Unique
c. Primary key: is a unique key and it must not be null. It can also be a foreign key too.
d. Foreign key: It is always used to interrelate two tables.
e. Check: Defines a condition that each row must satisfy
f. The Check constraint
g. Adding a constraint

SQL 02 DML

1) Data Manipulation Language: A DML statement is executed when you:


Add new rows to a table
Modify existing rows in a table
Remove existing rows from a table
2) The SYSDATE function records the current date and time
3) Use COMMIT to permanently save the changes made to the database
4) Use ROLLBACK to undo the previous operation.
5) You cannot delete a row that contains primary key which is foreign key in another table.
6) A DBMS that fully implements SQL2 should support and enforce all the integrity constraints that
can be specified in the DDL.
7) A DBMS enforcing NOT NULL will reject an INSERT command in which an attribute declared to be
NOT NULL does not have a value.
8) A DBMS not supporting referential integrity will allow insertion even if the referential integrity
constraint is violated.

SQL 03

1) FROM Specifies table(s) to be used.


2) WHERE Filters rows.
3) GROUP BY Forms groups of rows with same column value.
4) HAVING Filters groups subject to some condition.
5) SELECT Specifies which columns are to appear in output.
6) ORDER BY Specifies the order of the output
7) Select: Column, rows, sorting, aggregation, grouping, restricting Groups, Aliasing Table Name,
Nested queries, Join, Set Ops.
8) Operator Procedure: * / + -
9) Defining a Null: A null is a value that is unavailable, unassigned, unknown, or inapplicable.
A null is not the same as a zero or a blank space.

DBMS
1) Data is managed most efficiently when stored in a database
2) Databases evolved from computer file systems
3)
4) DATA > Info > KNOWLEDGE > WISDOM
5) A system is a group of elements that are integrated with the common purpose of achieving
objectives.
6) Information system: Interrelated components are working together to collect, process, store and
disseminate information (ESS, DSS, MIS, KWS)
7) Artifacts OF IS: SQL Programming, coding, designing, web & GUI.
8) DATABASE: shared, integrated computer structure that stores a collection of:
End-user data: raw facts of interest to end user
Metadata: data about data
Provides description of data characteristics and relationships in data
Complements and expands value of data
9) Database management system (DBMS): A software system designed to store, manage, and
facilitate access to databases.
10) Reasons for studying file systems:
Complexity of database design is easier to understand
Understanding file system problems helps to avoid problems with DBMS systems
Knowledge of file system is useful for converting file system to database system
11) File systems typically composed of collection of file folders, each tagged and kept in cabinet
12) Files: A collection of records or documents dealing with one organization, person, area, or
subject. It could either be:
Computer files
Manual files (Paper)
13) Database: A collection of similar records with relationships between records.
Statistical, Business Data
14) Problems with File System:
a. Lengthy Development Times
b. Difficult of getting quick answer
c. Complex system administration
d. Lack of security and limited data sharing
e. Extensive programming
f. Data Redundancy: Unnecessarily storing same data at different places
g. Data inconsistency: different and conflicting versions of same data occur at different
places
h. Data anomalies: abnormalities when all changes in redundant data are not made
correctly
15) The database holds not only the data but also a description of the data.
16) Advantages of Database approach:
a. No or Planned data redundancy.
b. Improved data consistency
c. Improved data sharing
d. Enforcement of standards
e. Program-data independence
i. The separation of data descriptions from the application programs that use the
data.
ii. Allows the data to change without changing the application programs.
17) DBMS is a software package that enables the user to create and maintain databases.
a. Defining a database involves specifying the data types, structures, and constraints for
the data to be stored in the database.
b. Constructing a database which is the process of storing the data.
c. Manipulating a database such as functions of querying and sharing the database objects,
updating the database, and generating reports from the data.
18) DBMS Advantage
a. Minimal data redundancy
b. Consistency of data
c. Integration of data
d. Sharing of data
e. Ease of application development
f. Uniform security, privacy, and integrity controls
g. Data accessibility and responsiveness
h. Reduced program maintenance
i. Data independence
19) DBMS Disadvantage
a. Increased Costs
b. Vendor dependence
c. Replacement cycle
20) Popular DBMS: SQ Lite, Oracle, SQL Server, My SQL, SY BASE,
21) Database system: defines and regulates the collection, storage, management, use of data
22) Five major parts of a database system:
Hardware
Software
People
Procedures
Data

You might also like