Trigger.
To delete records where FirstName is Peter in the Persons Table, you can use the following SQL query: DELETE FROM Persons WHERE FirstName = 'Peter';
The SQL command that can be used to retrieve all data from a table is the SELECT Ex: Let us say we have a table called employee_master which contains 3 columns emp_name, emp_number, date_of_joining you can retrieve all the data by using the below command SELECT * FROM employee_master or SELECT emp_name, emp_number, date_of_joining FROM employee_master
A view table.
Both Views and Indexes are created on top of a table but each of them serve a specific purpose. An Index is a data structure that is created to improve the performance of the data fetch operations on a table A view is similar to a table but may contain data from one or more tables connected to one another through a business logic. A view can be created to implement business logic or to conceal the underlying table implementation from everyone
Outer Join in SQL is used to retrieve all records from one table and only matching records from another table. It helps to retrieve data from related tables even if there are no matching records in one of the tables.
create view vw_active_employee as select * from employee where status = 'Active' after creating the view, view can be used as a table to see active employee. e.g. select * from vw_active_employee Basically we save sql as a database object, so that we can use that in future as a virtual table.
temp table
Some of the operations performed in DDL in sql are creation of table,alteration of table,truncate a table, drop a table
A virtual function table is a table of pointers to functions.
View is a virtual table that do not have any data of its own but have data that is derived from another table called base table. Create view is the command used to create a view (virtual table).
A primary key field in a sql table is created using the PRIMARY KEY keyword. ex: CREATE TABLE tbl_employee ( emp_num VARCHAR(10), emp_name VARCHAR(100), PRIMARY KEY (emp_num)) The above script creates a table called tbl_employee and sets the emp_num field as the primary key
no. a new table does not exist after a join command. All that is doing is temporarily pulling the data from the tables. If this command was one that you would want to do often, you can create a VIEW, which is a virtual table. It is an object that pulls data from one or more tables based on your search criteria.
To delete records where FirstName is Peter in the Persons Table, you can use the following SQL query: DELETE FROM Persons WHERE FirstName = 'Peter';
SQL CREATE VIEW achieves the creation of a table or tables in the SQL database. One can then create tables to the purpose they desire and fill them in with information.
using aliases: SELECT a.some_fields, b.other_fields FROM table a, table b WHERE a.foreign_key=b.primary_key;
The SQL command that can be used to retrieve all data from a table is the SELECT Ex: Let us say we have a table called employee_master which contains 3 columns emp_name, emp_number, date_of_joining you can retrieve all the data by using the below command SELECT * FROM employee_master or SELECT emp_name, emp_number, date_of_joining FROM employee_master
SQL UPDATE statement is used to modify a record in a table.