Lab 1&2
Lab 1&2
Lab1
Lab2:
Syntax:
Syntax:
Example:
client_no VARCHAR(6),
name VARCHAR(20),
address1 VARCHAR(30),
address2 VARCHAR(30),
city VARCHAR(15),
state VARCHAR(15),
pincode NUMBER,
bal_due NUMBER
);
This creates a table named client_master with columns like client_no of type VARCHAR(6), name of
type VARCHAR(20), and others with specified data types and sizes.
Syntax:
This creates a new table named new_client_master and copies data for columns client_no, name,
and city from the client_master table.
Syntax:
Example:
This inserts a new row into the client_master table with client_no as 'C001', name as 'John Doe', and
city as 'New York'.
Syntax:
Example:
This inserts data into the new_client_master table by selecting client_no, name, and city from the
client_master table.
Syntax:
Example:
Syntax:
Example:
This retrieves all columns and rows from the client_master table.
Syntax:
Example:
This retrieves only the client_no and name columns from the client_master table.
Syntax:
Example:
This retrieves distinct values from the city column of the client_master table, eliminating duplicates.
Syntax:
WHERE searchcondition;
Example:
This retrieves client_no and name for rows where city is 'New York' from the client_master table.
client_no VARCHAR(6),
name VARCHAR(20),
address1 VARCHAR(30),
address2 VARCHAR(30),
city VARCHAR(15),
state VARCHAR(15),
pincode NUMBER,
bal_due NUMBER
);
2. product_master Table:
product_no VARCHAR,
description VARCHAR,
profit_percent NUMBER,
unit_measure VARCHAR,
qty_on_hand NUMBER,
reorder_lvl NUMBER,
sell_price NUMBER,
cost_price NUMBER
);
These CREATE TABLE statements define the columns, their data types, and sizes as specified.