Unit2 Flashcards
SQL requires the use of the ______ command to enter data into a table.
Insert
Thus far, you have entered rows in which all of the attribute values are specified. But what do you do if a column does not have any available data? In those cases, you would want to leave the column with a valuer of null.
Inserting Rows with Null Attributes
There might be occasions when more than one attribute is optional. Rather than declaring each attribute as NULL in the INSERT command, you can indicate just the attributes that have required values. You do that by listing the attribute names inside parentheses after the table name.
Inserting Rows with Optional Attributes
The ______ command is used to list the contents of a table.
Select statements
list all attributes. A wildcard character is a symbol that can be used as a general substitute for other characters or commands.
*
Use the _____ command to modify data in a table.
Update statements
It is easy to delete a table row using the _____;
Delete statements
To add multiple rows to a table, using another table as the source of the data.
Inserting Rows from another table
Selecting Rows with Conditional Restrictions
Select Queries
SQL accepts any valid expressions (or formulas) in the computed columns. Such formulas can contain any valid mathematical operators and functions that are applied to attributes in any of the tables specified in the FROM clause of the SELECT statement.
Computed Columns
An alias is an alternative name given to a column or table in any SQL statement
Aliases
is a function that returns the current system date in sql server
getdate()
is a TSQL function that add a particular date interval from a given column or value. Its accepts the following parameters
dateadd()
is a function that returns the current system date in mysql
curdate()
is a MySQL function that subtracts a particular date interval from a given column or value. Its accepts the following parameters
date_sub