Source Code Dbms
Source Code Dbms
SQL 7
-- Create Employees table
CREATE TABLE Employees (
employee_id INT PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
department_id INT,
salary DECIMAL(10, 2),
hire_date DATE
);
-- Insert sample data into Employees table
INSERT INTO Employees
VALUES
(1, 'John', 'Doe', 101, 50000.00, to_date('2020-01-15','yyyy-mm-dd'));
INSERT INTO Employees VALUES
(2, 'Jane', 'Smith', 102, 60000.00, to_date('2019-07-20','yyyy-mm-dd'));
INSERT INTO Employees VALUES
(3, 'Alice', 'Johnson', 101, 55000.00, to_date('2021-03-10','yyyy-mm-dd'));
INSERT INTO Employees VALUES
(4, 'Bob', 'Williams', 103, 62000.00, to_date('2018-11-05','yyyy-mm-dd'));
INSERT INTO Employees VALUES
(5, 'Emily', 'Brown', 102, 58000.00, to_date( '2020-09-30','yyyy-mm-dd'));
create table t0
(s_no_1 number(3) primary key);
create table t1
(s_no_1 number(3) not null,
s_no_2 number(3) unique,
s_no_3 number(3) check(s_no_3>100),
s_no_4 number(4) primary key,
s_no_5 number(3),
constraint fk_s_no_5 foreign key (s_no_5) references t0 (s_no_1)
);
SQL 9
create table customer_test(no1 number(3), no2 number(3));
commit;
insert into customer_test values (1,2);
savepoint a;
insert into customer_test values (3,4);
savepoint b;
insert into customer_test values (5,6);
savepoint c;
insert into customer_test values (7,8);
rollback to c;