Oracle SQL Flashcards
What is an RDBMS?
It stands for Relational Database Management system which is a program that allows you to create, update, and save data in a relational database.
What is an ERD?
An ERD is a Entity Relationship Diagram, which is a diagram that maps out your database tables and the multiplicity and their relationships to each other.
What is SQL?
SQL stands for Structured Query Language and it’s a programming language used to communicate with the data stored in relational database management system.
What are sub-languages of SQL?
Data Definition Language, Data Manipulation Language, Data Query Language, Data Control Language, Transaction Control Language
What is DDL?
It stands for Data Definition Language and it is used to define tables and set their properties. With it, you can create a table, alter the properties of the table and drop the table.
What is DML?
DML stands for Data Manipulation Language, commands used are to insert data into the database, modify the data of the database and to delete data from the database.
What is DCL?
DCL stands for data control language, and its the sub language that’s used to grant and revoke users of their rights and permissions to a database
What is DQL?
DQL stands for Data Query Language, it is used to retrieve data from the database.
What is TCL?
TCL stands for Transaction control language, which are used to manage transactions in database with commit, rollback, and savepoint.
What is a database?
It is a structured collection of data that is stored in a computer or server and can be accessed and manipulated in various ways.
What are Objects in SQL?
- Objects in SQL are any defined object that can store or reference data.
- The database contains Schema objects that contain table objects and views
- Columns are the smallest data object
What are Tables?
Tables are data objects under a schema object and it holds columns that contain your data entries.
What are Views?
- Views are virtual tables based on the stored result-set of a SQL statement.
- A views fields are fields from one or more real tables in the database.
- You can store views in variables and perform operations to update or alter the view.
What are Triggers? When can it execute?
- A trigger is a database object that executes one or more SQL statements when a specified operation is done.
- You can define when a trigger fires when you define the trigger
What is an Index?
- An index is used to speed up the performance of queries.
- It does so by reducing the number of database data pages that have to be scanned/visited.
- In SQL Server, a clustered index determines the physical order of data in a table.
There can only be one clustered index per table (the clustered index is the table).
What is a Cursor?
- A cursor is a temporary work area created in the system memory when a SQL statement is executed.
- A cursor contains information on a select statement and the rows accessed by it.
- This temporary work area is used to store the data retrieved from the database, and manipulate this data.
What is a Sequence?
- A sequence is a user-defined, schema-bound object that generates a sequence of numeric values according to the specification with which the sequence was created.
- The sequence of numeric values is generated in an ascending order or descending order at a defined interval and can be configured to restart when exhausted.
What is a Constraint?
Constraints are rules used to limit the type of data that can go into a table.
What are the different relationships in SQL?
- One-to-one - both tables can have only one record on either side of the relationship.
- One-to-many - one table can only have one record on its side of the relationship while others can have many records of the relationship
- Many-to-many - both sides can have many records on either side of the relationship.
What is a Primary Key?
A primary key is a field in a table which uniquely identifies each row/record in a database table.
What is a Foreign Key?
- A foreign key is a column (or columns) that references a column that is the primary key of another table.
- The purpose of the foreign key is to insure referential integrity of the data.