SQL Flashcards
Define SQL?
Structured query language is the standard command set used to communicate with the relational database management system.
Define Dbms?
A Database Management system consists of a collection of interrelated data and set of programs to access that data.
What is the purpose of Database systems?
Database Management system provides a secure and survivable medium for the storage and retrieval of data.In the real world, the data is shared among several users and is persistent.
State the different between Security and Integrity?
A Database Management system provides a secure and survivable medium for the storage and retrieval of data.In the real world, the data is shared among several users and is persistent.
State the different between Security and Integrity?
Security is a protection from malicious attempts to steal or modify data.
Integrity constraints guard against accidental damage to the database, by ensuribg that authorized changes to the database do not result in a loss of data consistency.
Define Normalisation?
Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.
What are the purpose of Normalisation?
■Minimize redundancy in data.
■Remove insert, delete and update anamoly during the database activities.
■Reduce the need to reorganize data it is modified or enhanced.
Define Primary Key?
■The primary key is the columns used to uniquely identify each row of a table.
■A table can have only one primary key.
■No primary key value can appear in more than one row in the table.
Define Unique Key?
Unique key is a one or more column that must be unique for each row of the table.
It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.
Define Foreign Key?
A foreign Key is a combination of columns with value is based on the primary key values from another table. A foreign key constraint also known as Referential Integrity Constraint.
Define View?
■A View is a database object that is a logical representation of a table.
■It is derived from a table but has no longer of its own and often may be used in the same manner as a table.
■A view is a virtual table that has columns similar to a table.
■A view does not represent any physical data.
Compare and contrast TRUNCATE and DELETE for a table?
Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete.
What is cursors?
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.
Define SubQuery?
■Nesting of Queries one within the other is called as a Subquery.
■A table can have only one primary key.
What are the different types of subquery?
■Single row subquery
■Multiple row subquery
■Correlated row subquery
What are the different types of replication?
The SQL Server 2000-supported replication types are as follows ■Transactional
■Snapshot
■Merge
What is User Defined Functions?
User-Defined Functions allow to define its own T-SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type.
Define Self Join?
Self join means joining one table with itself.
The self join can be viewed as a join of two copies of the same table.
Define Sequence?
A Sequence is a database object that can be used to provide very quick generation of unique numbers.
Define Joins?
A Join combines columns and data from two or more tables (and in rare cases, of one table with itself).
What are the types of Joins?
■Equi joins
■Cartesian Joins
■Outer Joins
■Self Joins.
Define Equi Joins?
A Equi Join is a join in which the join comparison operator is an equality. When two tables are joined together using equality or values in one or more columns, they make an Equi Join.
Define Cartesian Join?
Joining two tables without a whereclause produces a Cartesian join which combines every row in one table with every row in another table.
What are three SQL keywords used to change or set someone’s permissions?
GRANT, DENY, and REVOKE