Question- How will You create a MySQL database and tables ?
Answer- If you want to create a database and set up tables for the same use the following two sql commands:
CREATE DATABASE - create the database
CREATE TABLE - create the table
INSERT - To add/insert data to table
CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database
CREATE TABLE creates...
Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts
October 15, 2013
October 14, 2013
Question- How will You extend a MySQL table with additional columns ?
Answer-
MySQL tables are easy to extend with additional columns.
To add a column called email to the contacts table created in Create a basic MySQL table with a datatype of VARCHAR(80)
use the following SQL statement:
ALTER TABLE contacts ADD email VARCHAR(60);
This
first statement will add the email column to the end of the table. To
insert the new column after...
SQL Functions
SQL functions are built into Oracle and are available for use in various appropriateSQL statements. Do not confuse SQL functions with user functions written inPL/SQL.
If you call a SQL function with an argument of a datatype other than the datatype expected by the SQL function, then Oracle implicitly converts the argument to the expected datatype before performing the SQL function. If you call a SQL function with a null argument,...