[go: up one dir, main page]

0% found this document useful (0 votes)
16 views2 pages

Dba Lab 1

The document outlines SQL commands for managing a customer details table, including creating the table, inserting records, selecting specific data, deleting records, altering the table structure, and updating existing records. It specifies fields such as customer ID, name, country, age, and phone number. Additionally, it demonstrates various SQL operations like SELECT, DELETE, UPDATE, and ALTER TABLE.

Uploaded by

vishaldevi2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Dba Lab 1

The document outlines SQL commands for managing a customer details table, including creating the table, inserting records, selecting specific data, deleting records, altering the table structure, and updating existing records. It specifies fields such as customer ID, name, country, age, and phone number. Additionally, it demonstrates various SQL operations like SELECT, DELETE, UPDATE, and ALTER TABLE.

Uploaded by

vishaldevi2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE TABLE cusr_details (

customer_id NUMBER PRIMARY KEY,

customer_firstname VARCHAR2(40) NOT NULL,

customer_lastname VARCHAR2(40) NOT NULL,

country VARCHAR(40) NOT NULL,

age NUMBER NOT NULL,

phone_number VARCHAR(25) NOT NULL

);
2)

insert into
Cusr_details(customer_id,customer_firstname,customer_lastname,country,age,phone_number)

values

(1, 'John', 'Doe', 'USA', 25, '1234567890'),

(2, 'Alice', 'Smith', 'Canada', 30, '0987654321'),

(3, 'Mahesh', 'Kumar', 'India', 28, '9876543210'),

(4, 'Sophia', 'Brown', 'USA', 21, '5678901234');

3) a.SELECT customer_firstName FROM Customer_Details;

b. SELECT *
FROM Cusr_Details

WHERE country = 'USA';

4) delete from Cusr_details where age=21;

5) ALTER TABLE Customer_Details

ADD Address VARCHAR2(100);

6) UPDATE Customer_Details

SET customer_lastName = 'Reddy', country = 'UK'

WHERE customer_firstName = 'Mahesh';

7) ALTER TABLE Cusr_details MODIFY COLUMN customer_firstName VARCHAR(50);

You might also like