50 Interview Questions Flashcards
What is a database?
An organized collection of data
What is DBMS?
Database Management System. The software used to create and manage the database.
What is RDBMS?
Relational Database Management System. RDMS stores data in tables and the relationships between those tables can be defined by common fields.
What is SQL?
Structured Query Language. The standard language for RDBMS
What is the difference between SQL and mySQL?
SQL is the language used to manipulate relational databases. MySQL is a RDBMS
What are Tables and Fields?
Tables are collections of data stored in rows and columns. Fields are the columns. Rows are the records.
What are constraints in SQL?
Rules for data in a table. Can be applied during creation of a table or after creation using ALTER TABLE command
Constraint 1: NOT NULL
Prevents NULL values from being inserted into a column
Constraint 2: CHECK
Verifies that all values in a field satisfy a condition
Constraint 3: DEFAULT
Automatically assigns a default value if no value has been specified for the field.
Constraint 4: UNIQUE
Ensures unique values to be inserted into the field. Unlike primary key, there can be multiple unique constraints defined per table.
Constraint 5: INDEX
Indexes a field providing faster retrieval of records.
Constraint 6: PRIMARY KEY
Indexes a field providing faster retrieval of records. Must contain UNIQUE values and has implicit NOT NULL constraint. A table in SQL is strictly restricted to have one and only one primary key, which is comprised of single or multiple fields
Constraint 7: FOREIGN KEY
Comprises of single or collection of fields in a table that essentially refer to the PRIMARY KEY in another table. Foreign key constraint ensures referential integrity in the relation between two tables.
What is a JOIN?
The SQL Join clause is used to combine records (rows) from two or more tables in a SQL database based on a related column between the two.