Lab 6 : Exercise on Create, Insert, Select and Join Query with DBMS concepts

A binary relationship with 1:1 cardinality ratio, an employee can have one car and a car is used by one employee only. Do the following action as per your DBMS concepts

1. Create necessary tables with constraint and necessary field
2. Insert values to tables
3. Show values
4. Find the id and the type of car assigned to employee ‘123’
5. Find the name of the employee and the make(type) of the car, if she/he drives car 987.         Where 987 is the id of a particular car.


43 comments:

  1. 1. create table employee( id number, name varchar(20), constraint id_pk primary key(id));
    create table car( empid number, carid number, type varchar(15), constraint empid_fk(empid) references employee(id));

    2. insert into employee values( 123,'Nayan');
    insert into employee values( 234,'Shazal');
    insert into employee values( 345,'Bappi');
    insert into employee values( 789,'AN');

    insert into car values( 123,321,'Sports Car');
    insert into car values( 234,432,'Bus');
    insert into car values( 345,543,'Track');
    insert into car values( 789,987,'Private car');

    3. select * from employee;
    select * from car;

    4. select carid,type from car where empid = 123;

    5. select name,type from employee,car where employee.id = car.empid AND carid=987;

    ReplyDelete
  2. 1.

    create table employee
    2.(
    employee_id number, name varchar(10)
    3.);
    add constraint employee_id_pk primary key(id));

    create table car
    2.(
    3. employee_id number, car_id number, type varchar(20)
    3.);
    add constraint employee_id_fk(employee_id) ;

    2. insert into employee values( 123,'A');
    insert into employee values( 456,'C');
    insert into employee values( 789,'B);

    insert into car values( 123,321,'Car');
    insert into car values( 456,654,'Bus');
    insert into car values( 789,987,'Train');

    3. select * from employee;
    select * from car;

    4. select car_id,type from car where employee_id = 123;

    5. select name,type from employee,car where employee.id = car.employee_id AND car_id=987;

    ReplyDelete
  3. SQL*Plus: Release 10.2.0.3.0 - Production on Sat Nov 29 08:58:09 2014

    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL> create table employe
    2 (
    3 employe_id integer,
    4 employe_name varchar(10),
    5 primary key(employe_id));

    Table created.

    SQL> desc employe

    SQL> insert into employe values(123,'tamim');

    1 row created.

    SQL> insert into employe values(456,'shah');

    1 row created.

    SQL> insert into employe values(789,'mahmud');

    1 row created.

    SQL> select * from employe;

    SQL> create table car
    2 (
    3 car_id integer,
    4 car_type varchar(15),
    5 employe_id integer,
    6 primary key(car_id),
    7 foreign key(employe_id) references employe)
    8 ;

    Table created.

    SQL> desc car

    SQL> insert into car values(321,'porsche',123);

    1 row created.

    SQL> insert into car values(654,'Ford',456);

    1 row created.

    SQL> insert into car values(987,'Mazda',789);

    1 row created.

    SQL> select * from car;

    //Find the id and the type of car//

    SQL> select car_id,car_type
    2 from car,employe
    3 where employe.employe_id=car.employe_id and
    4 employe.employe_id=123;

    //Find the name of the employee and the type of the car//

    SQL> select employe_name,car_type
    2 from car,employe
    3 where employe.employe_id=car.employe_id
    4 and
    5 car_id=987;

    SQL> exit

    ReplyDelete
  4. 1/
    create table employee( emp_id numeric(10), emp_name varchar(25),
    constraint emp_idpk primary key(emp_id));
    ##
    create table car( emp_id numeric (10), car_id numeric(10), type varchar(10), constraint emp_idfk(emp_id) references employee(emp_id));

    2/
    insert into employee values( 123,'X');
    insert into employee values( 331,'Y');
    insert into employee values( 769,'Z');


    insert into car values( 123,355,'Ford');
    insert into car values( 331,432,'Microbus');
    insert into car values( 769,987,'Jeep');

    3/
    select * from employee;
    select * from car;

    4/
    select car_id,type from car where emp_id = 123;

    5/
    select name,type from employee,car where employee.id = car.emp_id AND car_id=987;

    ReplyDelete
  5. create table employee
    (
    emp_id numeric(5) primary key,
    name varchar(15) not null
    );
    create table car
    (
    emp_id numeric(5) unique key,
    car_id varchar(12) primary key,
    car_type varchar(15)
    );
    2.insert into employee
    values(&emp_id,'&name')
    values(123,'mamun')
    values(321,'sumon')
    values(124,'rahim');
    insert into car
    values(&emp_id,'&car_id','&car_type')
    values(123,'b666','ford')
    values(321,'k456','jeep')
    values(124,'987','microbus');
    3.
    select*from employee;
    emp_id name
    123 mamun
    321 sumon
    124 rahim
    select*from car
    emp_id car_id car_type
    123 b666 ford
    321 k456 jeep
    124 987 microbus
    4.select car_type from employee,car
    where emp_id='123';
    5.select name,car_type from employee,car
    where emp_id=car_id and car_id='987';

    ReplyDelete
  6. 1. create table employees
    ( emp_id number(5),
    emp_name varchar(10),
    constraint emp_id_pk primary key(id));
    Table created.

    create table cars

    ( emp_id number(5),

    car_id number(5),

    car_type varchar(10),

    constraint emp_id_fk(emp_id) references employees(emp_id));

    Table created

    2. insert into employees values( 4523,'x');
    insert into employees values( 4635,'y');
    insert into employees values( 3457,'m');
    insert into employees values( 7869,'n');

    insert into cars values( 123,321,'A');
    insert into cars values( 234,432,'B');
    insert into cars values( 345,543,'T');
    insert into cars values( 789,987,'N');

    3. select * from employees;
    select * from cars;

    4. select car_id,type from cars where emp_id = 4523;

    5. select name,type from employees,cars where employees.id = cars.emp_id AND car_id=7869;

    ReplyDelete
  7. 1.create table emp00( emp_id numeric(11), emp_name varchar(13),
    add constraint emp00pk primary key(emp_id));

    create table car( emp_id numeric (11), car_id numeric(17), type varchar(12), add constraint emp00fk(emp_id) references emp00(emp_id));

    2.insert into emp00 values( 123,'suzan');
    insert into emp00 values( 312,'rahim');
    insert into emp00 values( 769,'karim');


    insert into car00 values( 123,355,'minicar');
    insert into car00 values( 312,432,'bus');
    insert into car00 values( 769,987,'pick up');

    3.select * from emp00;
    select * from car00;

    4.select car_id,type from car00 where emp_id = 123;

    5.select name,type from emp00,car00 where emp00.id = car00.emp_id AND car_id=987;

    ReplyDelete
  8. 1. create table employee( id number, name varchar(20));
    alter table employee
    add constraint id_pk primary key(id);
    create table car( empid number, carid number, type varchar(15), constraint empid_fk(empid) references employee(id));

    2. insert into employee values( 123,'Nayan');
    insert into employee values( 234,'Shazal');
    insert into employee values( 345,'Rumel');
    insert into employee values( 789,'Kabir');

    insert into car values( 123,321,'Private Car');
    insert into car values( 234,432,'Micro');
    insert into car values( 345,543,'Bike');
    insert into car values( 789,987,'Van);

    3. select * from employee;
    select * from car;

    4. select carid,type from car where empid = 123;

    5. select name,type from employee,car where employee.id = car.empid AND carid=987;

    ReplyDelete
  9. create table employee
    (
    emp_id number(5),
    emp_name varchar2(100 byte) not null,
    constraint emp_emp_id primary key(emp_id)
    );

    insert into employee values
    (
    123,
    'shohan'
    );

    insert into employee values
    (
    3,
    'shuvo'
    );

    create table car
    (
    emp_id number(5),
    car_id number(5),
    type varchar2(100 byte) not null,
    constraint car_car_id primary key(car_id),
    constraint emp_id_fk foreign key(emp_id) references employee
    );

    insert into car values
    (
    123,
    988,
    'Racing car'
    );

    insert into car values
    (
    3,
    987,
    'Racing car'
    );

    select * from employee;
    select * from car;
    select car_id,type from car where emp_id=123;
    select e.emp_name,c.type from employee e,car c where e.emp_id=c.emp_id and car_id=987;

    ReplyDelete
  10. create table employee
    (
    emp_id number(5),
    emp_name varchar2(100 byte) not null,
    constraint emp_emp_id primary key(emp_id)
    );

    insert into employee values
    (
    123,
    'shohan'
    );

    insert into employee values
    (
    3,
    'shuvo'
    );

    create table car
    (
    emp_id number(5),
    car_id number(5),
    type varchar2(100 byte) not null,
    constraint car_car_id primary key(car_id),
    constraint emp_id_fk foreign key(emp_id) references employee
    );

    insert into car values
    (
    123,
    988,
    'Racing car'
    );

    insert into car values
    (
    3,
    987,
    'Racing car'
    );

    select * from employee;
    select * from car;
    select car_id,type from car where emp_id=123;
    select e.emp_name,c.type from employee e,car c where e.emp_id=c.emp_id and car_id=987;

    ReplyDelete
  11. step-1
    --------
    create table employee1
    (
    emp_id number(15)primary key,
    name varchar2(30)
    );

    create table car
    (
    emp_id number(15),
    car_id number(15),
    car_name varchar2(30),
    constraint car_fk1_emp foreign key(emp_id)references employee1(emp_id)
    );

    step-2:
    --------
    insert into employee1 values(123,'Md.Monirul Islam');

    insert into employee1 values(234,'Md.Masud Rana');

    insert into employee1 values(456,'Mustafizur Rahman');

    insert into car values(123,589,'BMW');
    insert into car values(234,987,'G-COROLLA');
    insert into car values(456,457,'LADD CRUISSER PRADO');

    STEP-3:
    ---------
    select *from employee1;
    select * from car;

    STEP-4:
    -------
    select car_id,car_name from car where emp_id=123;

    STEP-5:
    ---------
    select name,car_name from employee1,car where employee1.emp_id=car.emp_id and car_id=987;




    ReplyDelete
  12. 1.
    CREATE TABLE employee_(
    employee_id number(10)primary key,
    employee_name varchar2(30)
    )
    create table car(
    employee_id number(10),
    car_id varchar2(10),
    car_type varchar2(30),
    constraint emp_id_fk1 foreign key(employee_id) references employee_(employee_id)
    )
    2.
    INSERT INTO employee_
    VALUES(123,'Monirozzaman');
    INSERT INTO employee_
    VALUES(124,'Jashim Uddin');
    INSERT INTO employee_
    VALUES(125,'Tariqul');
    INSERT INTO employee_
    VALUES(127,'Amir Sltan');

    INSERT INTO car
    VALUES(123,244,'Honda');
    INSERT INTO car
    VALUES(124,113,'Lexus');
    INSERT INTO car
    VALUES(125,987,'BMW');
    INSERT INTO car
    VALUES(127,502,'Nissan');

    3.
    SELECT * FROM EMPLOYEE_;
    SELECT * FROM CAR;
    4.
    SELECT car_id,car_type FROM car WHERE employee_id=123;
    5.
    SELECT employee_name,car_type FROM employee_,car
    WHERE employee_.employee_id=car.employee_id AND car_id=987;

    ReplyDelete
  13. create table employee
    (
    id number,
    name varchar(20),
    constraint id_pk primary key(id)
    );
    desc employee;

    create table car
    (
    emp_id number(4),
    car_id number(4),
    type varchar(20),
    constraint car_fk1 foreign key(emp_id)references employee(id)
    );

    insert into employee values( 123,'Mahmudul');
    insert into employee values( 124,'Hasan');
    insert into employee values( 125,'Rubel');
    insert into employee values( 126,'Saiful');

    insert into car values( 123,985,'bmw i8');
    insert into car values( 124,986,'nissan');
    insert into car values( 125,987,'toyota corolla');
    insert into car values( 126,988,'marcity car');

    select * from employee;
    select * from car;


    select car_id,type from car where emp_id = 125;

    select name,type from employee,car where employee.id = car.emp_id AND car_id=987;

    ReplyDelete
  14. student id: 201430308

    //create a table for employee
    create table employee
    (
    id number(4),
    name varchar(20),
    constraint id_pk primary key(id)
    );
    //see the employee
    desc employee;
    //create a car table cal a foregin key
    create table car
    (
    empid number(4),
    carid number(3),
    type varchar2(15),
    constraint car_fk1 foreign key(empid)references employee(id)
    );
    //insert values into table employee
    insert into employee values( 123,'saiful');
    insert into employee values( 555,'Hasan');
    insert into employee values( 777,'Rubel');
    insert into employee values( 666,'alim');
    //insert values into table car
    insert into car values( 123,987,'forid');
    insert into car values( 555,432,'land rovar');
    insert into car values( 666,543,'aston martin');
    insert into car values( 777,986,'maserati');
    //view employee
    select * from employee;
    //view car
    select * from car;

    //call carid and type by empid
    select carid,type from car where empid = 123;
    //call quary from both table
    select name,type from employee,car where employee.id = car.empid AND carid=987;

    ReplyDelete
  15. create table employee
    (
    id number,
    name varchar(20),
    constraint id_pk primary key(id)
    );
    desc employee;

    create table car
    (
    emp_id number(4),
    car_id number(4),
    type varchar(20),
    constraint car_fk1 foreign key(emp_id)references employee(id)
    );

    insert into employee values( 123,'Mahmudul');
    insert into employee values( 124,'Hasan');
    insert into employee values( 125,'Rubel');
    insert into employee values( 126,'Saiful');

    insert into car values( 123,985,'bmw i8');
    insert into car values( 124,986,'nissan');
    insert into car values( 125,987,'toyota corolla');
    insert into car values( 126,988,'marcity car');

    select * from employee;
    select * from car;


    select car_id,type from car where emp_id = 125;

    select name,type from employee,car where employee.id = car.emp_id AND car_id=987;

    ReplyDelete
  16. #Creating table(Step:1):

    create table employee_car
    (
    emp_id number(15)primary key,
    emp_name varchar(32)
    )


    create table car
    (
    emp_id number(15),
    car_name varchar(32),
    car_type varchar(32),
    car_id number(15),
    constraint fk_car foreign key(emp_id) references employee_car(emp_id)
    )


    #Inserting value into the table(Step:2):

    insert into employee_car values(123, 'rahim')
    insert into employee_car values(241, 'karim')
    insert into employee_car values(149, 'limon')
    insert into employee_car values(259, 'jashim')

    insert into car values(123, 'BMW', 'private', '987')
    insert into car values(241, 'hyundai', 'economy', '657')
    insert into car values(149, 'noah', 'family', '246')
    insert into car values(241, 'mercedes', 'luxury', '158')

    #Showing Value(Step:3):

    select *from employee_car;
    select *from car;

    #Inventory Method(Step:4&5):

    select car_id,car_type from car where emp_id = 123;
    select emp_name,car_type from employee_car,car where employee_car.emp_id = car.emp_id AND car_id=987:


    Student ID#201220985

    ReplyDelete
  17. student id =201430964
    create table labour
    ( lab_id number(10)primary key,
    lab_name varchar2(12)
    );
    create table car1(
    lab_id number(10),
    car_id number(11),
    car_type varchar2(11),
    constraint car_fk1 foreign key(lab_id)references labour(lab_id)
    );
    insert into labour
    values('11', 'sam');
    insert into labour
    values('123', 'bossee');
    insert into labour
    values('100','shah');
    insert into car1
    values('11','900','bus');
    insert into car1
    values('123','911','truck');
    insert into car1
    values('100','987','honda');
    select * from labour;
    select * from car1;
    select car_id,car_type from car1 where lab_id=123;
    select name,car_type from labour,car1 where lab_id =car1.lab_id and car_id=987;

    ReplyDelete
  18. Name: Sourav Dab Nath Roll : 201430865

    //create table which name employee
    create table employee
    (
    emp_id number(15)primary key,
    name varchar2(30)
    );

    //create table which name car
    create table car
    (
    emp_id number(15),
    car_id number(15),
    car_name varchar2(30),
    constraint car_fk1_emp foreign key(emp_id)references employee(emp_id)
    );

    //insert values in employee table

    insert into employee values(101,'Sourav Dab Nath');
    insert into employee values(102,'Md. Monirul Islam');
    insert into employee values(103,'Iminul haque');

    //insert values in car table

    insert into car values(101,201,'PAGARU');
    insert into car values(102,202,'COROLLA');
    insert into car values(103,203,'PRADO');

    //select employee and car table

    select *from employee;
    select * from car;

    // Show car id and car name which id no. 102

    select car_id,car_name from car where emp_id=102;

    // Show name and car name from imployee and which emp_id and car.emp_id are same that’s id no 203.

    select name,car_name from employee, car where employee.emp_id=car.emp_id and car_id=203;

    ReplyDelete
  19. Dabasis biswas
    student id =201430960
    create table labour
    ( lab_id number(10)primary key,
    lab_name varchar2(12)
    );
    create table car1(
    lab_id number(10),
    car_id number(11),
    car_type varchar2(11),
    constraint car_fk1 foreign key(lab_id)references labour(lab_id)
    );
    insert into labour values('11', 'sam');
    insert into labour values('123', 'bossee');
    insert into labour values('100','shah');

    insert into car1values('11','900','bus');
    insert into car1values('123','911','truck');
    insert into car1values('100','987','honda');

    select * from labour;

    select * from car1;

    select car_id,car_type from car1 where lab_id=123;

    select name,car_type from labour,car1 where lab_id =car1.lab_id and car_id=987;

    ReplyDelete
  20. # Student ID: 201430873 (47th)

    // Step - 1:

    create table Employee_CarInfo
    (
    Emp_ID number(10)primary key,
    Emp_Name varchar(30)
    );
    create table Car
    (
    Emp_ID number(10),
    Car_ID number(15),
    Car_Name varchar(30),
    Car_Type varchar(30),
    constraint fk_Car foreign key(Emp_ID) references Employee_CarInfo(Emp_ID)
    );
    // Step - 2:

    insert into Employee_CarInfo
    values(123, 'Rahimuddin');

    insert into Employee_CarInfo
    values(145, 'Mr. Asaduzzaman');

    insert into Employee_CarInfo
    values(165, 'Mrs.Lila Haque');

    insert into Employee_CarInfo
    values(359, 'Abdus Kaiyes');

    insert into Employee_CarInfo
    values(378, 'Susmita Khorana');

    insert into Employee_CarInfo
    values(352, 'Md.Razzak Hossain');

    select * from Employee_CarInfo;

    insert into Car
    values(123, '980', 'BMW', 'private');

    insert into Car
    values(145, '655','HYUNDAI', 'private');

    insert into Car
    values(165, '249','NOAH', 'private');

    insert into Car
    values(359, '158','MERCEDES', 'Luxury');

    insert into Car
    values(378, '487','NOHA', 'private');

    insert into Car
    values(352, '198','NISSAN', 'private');

    select * from Car;

    // Step - 3:

    select Car_ID ,Car_Type from Car where Emp_ID = 123;
    select Emp_Name,Car_Type from Employee_CarInfo,Car where Employee_CarInfo.Emp_ID = Car.Emp_ID AND Car_ID=980;

    ReplyDelete
  21. step-1
    --------
    create table employee1
    (
    emp_id number(15)primary key,
    name varchar2(30)
    );

    create table car
    (
    emp_id number(15),
    car_id number(15),
    car_name varchar2(30),
    constraint car_fk1_emp foreign key(emp_id)references employee1(emp_id)
    );

    step-2:
    --------
    insert into employee1 values(123,'Md.Monirul Islam');

    insert into employee1 values(234,'Md.Masud Rana');

    insert into employee1 values(456,'Mustafizur Rahman');

    insert into car values(123,589,'BMW');
    insert into car values(234,987,'G-COROLLA');
    insert into car values(456,457,'LADD CRUISSER PRADO');

    STEP-3:
    ---------
    select *from employee1;
    select * from car;

    STEP-4:
    -------
    select car_id,car_name from car where emp_id=123;

    STEP-5:
    ---------
    select name,car_name from employee1,car where employee1.emp_id=car.emp_id and car_id=987;




    ReplyDelete
  22. Monir Hossain
    ID:201710443
    Batch:54th

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('123','Monir Hossain')
    insert into
    Employees values('456','Noman')
    insert into
    Employees values('789','Anamul')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')
    select * from cars
    select * from cars where employee_id='123'

    ReplyDelete
  23. id:201710169(54th)
    values copy from monir hossain

    create table Employe
    (
    Employee_ID number(12),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employe

    create table Cars
    (
    Employee_ID number(12),
    Car_ID number(20),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employe(Employee_ID)
    );

    insert into
    Employe values('2010','anamul')
    insert into
    Employe values('2011','Noman')
    insert into
    Employe values('2012','rubel')

    select * from employe


    desc Cars

    insert into
    cars values('2010','987','Ferrari')
    insert into
    cars values('2011','258','BMW')
    insert into
    cars values('2012','369','Toyota')
    select * from cars
    select * from cars where employee_id='2012'


    ReplyDelete
  24. Name : Imtiaz Mahmud
    ID: 201710390
    Batch: 54th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );


    insert into
    Employees values('123','imtiaz mahmud')
    insert into
    Employees values('456','monir')
    insert into
    Employees values('789','Anamul')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    constraint uk unique(car_id)
    );


    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')

    //find id and car type of employee 123//
    select Employee_id,car_type from cars where employee_id=123;

    //find he name of employee and type of car 987//
    select employee_name,car_type from employees,cars where employees.emplyee_id=cars.employe_id and car_id=987;

    ReplyDelete
  25. https://drive.google.com/open?id=1afoBPkLGIfadGxXOUl_ROQUnKkNRIRER

    ReplyDelete
  26. Md. mahbub hasan noman
    Id: 201710445
    Batch:54th

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('123','Mahbub')
    insert into
    Employees values('456','Noman')
    insert into
    Employees values('789','Anamul')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')
    select * from cars
    select * from cars where employee_id='123'

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Md. Probal Chandara Das
    Id: 201710196
    Batch:54th
    Semester: Spring 2018

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('390','Shakil')
    insert into
    Employees values('943','Moniruzzaman')
    insert into
    Employees values('444','Humayun')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('390','987','Ferrari')
    insert into
    cars values('943','258','BMW')
    insert into
    cars values('444','369','Toyota')
    select * from cars
    select * from cars where employee_id='444'

    ReplyDelete
  29. id:201710117
    54th
    https://drive.google.com/open?id=1UcRQKcqZXRzD-nj6cU5uoGK5ZiiGt94U

    ReplyDelete
  30. Name :
    ID: 201710412
    Batch: 54 th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );


    insert into
    Employees values('123','Asha Rahman')
    insert into
    Employees values('456','Maria')
    insert into
    Employees values('789','Mnir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    constraint uk unique(car_id)
    );


    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')

    //find id and car type of employee 123//
    select Employee_id,car_type from cars where employee_id=123;

    //find he name of employee and type of car 987//
    select employee_name,car_type from employees,cars where employees.emplyee_id=cars.employe_id and car_id=987;

    ReplyDelete
  31. https://drive.google.com/open?id=1bJ9tqbN3Gf3GhaTVQoSpVu3y6wokbZk_
    sahadat hossain
    id:-201630522

    ReplyDelete
  32. Subrata Halder
    ID:201710572
    Batch: 24th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('123','subrata halder')
    insert into
    Employees values('456','ujjal')
    insert into
    Employees values('789','monir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('123','987','Corrolla')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')
    select * from cars
    select * from cars where employee_id='123'

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  33. Assignment on Database Management System.
    Course Code: CSE-3523S,
    Department B.sc in CSE (Dip),
    Name: Md Rubel Rana,
    ID : 201710580,
    Batch: 54th.


    Lab 06 :

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('022','Rubel')
    insert into
    Employees values('055','Zakir')
    insert into
    Employees values('088','monir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('022','2560','Corrolla')
    insert into
    cars values('055','2480','BMW')
    insert into
    cars values('088','3920','Toyota')
    select * from cars
    select * from cars where employee_id='055'

    ReplyDelete
  34. Name: Ujjal Halder
    ID:201710571
    Batch:54

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('123','subrata halder')
    insert into
    Employees values('456','ujjal')
    insert into
    Employees values('789','monir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('123','987','Corrolla')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')
    select * from cars
    select * from cars where employee_id='123'

    ReplyDelete
  35. Subrata Halder
    ID:201710572
    Batch: 54th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('123','subrata halder')
    insert into
    Employees values('456','ujjal')
    insert into
    Employees values('789','monir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('123','987','Corrolla')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')
    select * from cars
    select * from cars where employee_id='123'

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Name : jafrul Alam
    ID: 201710366
    Batch: 54 th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );


    insert into
    Employees values('123','Alam')
    insert into
    Employees values('456','Maria')
    insert into
    Employees values('789','Mnir')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    constraint uk unique(car_id)
    );


    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')

    //find id and car type of employee 123//
    select Employee_id,car_type from cars where employee_id=123;

    //find he name of employee and type of car 987//
    select employee_name,car_type from employees,cars where employees.emplyee_id=cars.employe_id and car_id=987;

    ReplyDelete
  38. Name : Md. Al-amin
    ID: 201710348
    Batch: 54 th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );


    insert into
    Employees values('123','Alamin')
    insert into
    Employees values('456','alam')
    insert into
    Employees values('789','probal')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    constraint uk unique(car_id)
    );


    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')

    //find id and car type of employee 123//
    select Employee_id,car_type from cars where employee_id=123;

    //find he name of employee and type of car 987//
    select employee_name,car_type from employees,cars where employees.emplyee_id=cars.employe_id and car_id=987;

    ReplyDelete
  39. Md. Rukonuzzaman Rokon
    Id: 201630837
    Batch:54th
    Semester: Spring 2018

    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );

    desc Employees

    insert into
    Employees values('390','Shakil')
    insert into
    Employees values('943','Moniruzzaman')
    insert into
    Employees values('444','Humayun')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    );
    desc Cars

    insert into
    cars values('390','987','Ferrari')
    insert into
    cars values('943','258','BMW')
    insert into
    cars values('444','369','Toyota')
    select * from cars
    select * from cars where employee_id='444'

    ReplyDelete
  40. Name : Md. zakirul islam
    ID: 201530469
    Batch: 50th


    create table Employees
    (
    Employee_ID number(10),
    Employee_Name varchar2(20),
    constraint Employees_pk primary key(Employee_ID)
    );


    insert into
    Employees values('123','Alamin')
    insert into
    Employees values('456','alam')
    insert into
    Employees values('789','probal')

    select * from employees

    create table Cars
    (
    Employee_ID number(10),
    Car_ID number(15),
    Car_Type varchar2(20),
    constraint Cars_fk foreign key(Employee_ID) references Employees(Employee_ID)
    constraint uk unique(car_id)
    );


    insert into
    cars values('123','987','Ferrari')
    insert into
    cars values('456','258','BMW')
    insert into
    cars values('789','369','Toyota')

    //find id and car type of employee 123//
    select Employee_id,car_type from cars where employee_id=123;

    //find he name of employee and type of car 987//
    select employee_name,car_type from employees,cars where employees.emplyee_id=cars.employe_id and car_id=987;

    ReplyDelete

Popular Posts