Giter VIP home page Giter VIP logo

sql_assignment8's Introduction

SQL_Assignment8

1-test veritabanınızda employee isimli sütun bilgileri id(INTEGER), name VARCHAR(50), birthday DATE, email VARCHAR(100) olan bir tablo oluşturalım.

CREATE TABLE employee (
id SERIAL PRIMARY KEY,
name VARCHAR(50) not NULL,
birthday DATE,
email VARCHAR(100)
)

2-Oluşturduğumuz employee tablosuna 'Mockaroo' servisini kullanarak 50 adet veri ekleyelim.

insert into employee (name, birthday, email) values ('Kean Esterbrook', '2021-12-23', '[email protected]');
insert into employee (name, birthday, email) values ('Gayla Harman', '2021-12-22', '[email protected]');
insert into employee (name, birthday, email) values ('Cammie Rivel', '2021-04-04', '[email protected]');
insert into employee (name, birthday, email) values ('Mira Crossby', '2022-02-21', '[email protected]');
insert into employee (name, birthday, email) values ('Kasey Twigge', '2021-11-03', '[email protected]');
insert into employee (name, birthday, email) values ('Kristan MacQuist', '2021-03-17', '[email protected]');
insert into employee (name, birthday, email) values ('Vasili MacCaig', '2022-01-09', '[email protected]');
insert into employee (name, birthday, email) values ('Kalila Roalfe', '2021-08-14', '[email protected]');
insert into employee (name, birthday, email) values ('Sonni Wiltshire', '2021-08-24', '[email protected]');
insert into employee (name, birthday, email) values ('Glendon Teissier', '2021-07-31', '[email protected]');
insert into employee (name, birthday, email) values ('Ciel Slany', '2021-07-17', '[email protected]');
insert into employee (name, birthday, email) values ('Fayre Elcott', '2022-01-18', '[email protected]');
insert into employee (name, birthday, email) values ('Katharine Stanluck', '2022-01-24', '[email protected]');
insert into employee (name, birthday, email) values ('Shane Stuchbury', '2021-09-02', '[email protected]');
insert into employee (name, birthday, email) values ('Karlotte Wigzell', '2021-12-05', '[email protected]');
insert into employee (name, birthday, email) values ('Cymbre Brayshay', '2021-12-11', '[email protected]');
insert into employee (name, birthday, email) values ('Kristin Poor', '2021-04-09', '[email protected]');
insert into employee (name, birthday, email) values ('Edyth Tracey', '2021-10-01', '[email protected]');
insert into employee (name, birthday, email) values ('Bess Mowsdale', '2021-10-15', '[email protected]');
insert into employee (name, birthday, email) values ('Brittni Staneland', '2021-05-13', '[email protected]');
insert into employee (name, birthday, email) values ('Marcelle Creane', '2022-03-04', '[email protected]');
insert into employee (name, birthday, email) values ('Alleen Crews', '2021-12-22', '[email protected]');
insert into employee (name, birthday, email) values ('Kathlin Rennard', '2021-04-09', '[email protected]');
insert into employee (name, birthday, email) values ('Verla Berndsen', '2021-10-04', '[email protected]');
insert into employee (name, birthday, email) values ('Jocelyne Lethieulier', '2021-11-16', '[email protected]');
insert into employee (name, birthday, email) values ('Eran Tyres', '2021-06-20', '[email protected]');
insert into employee (name, birthday, email) values ('Sansone Chaize', '2022-01-18', '[email protected]');
insert into employee (name, birthday, email) values ('Alika Gregorin', '2021-08-09', '[email protected]');
insert into employee (name, birthday, email) values ('Brnaby Saunton', '2021-11-13', '[email protected]');
insert into employee (name, birthday, email) values ('Rutherford Klimpke', '2021-10-30', '[email protected]');
insert into employee (name, birthday, email) values ('Janette Ornils', '2022-02-15', '[email protected]');
insert into employee (name, birthday, email) values ('Kimbra Wile', '2021-09-06', '[email protected]');
insert into employee (name, birthday, email) values ('Waylan Spires', '2021-12-11', '[email protected]');
insert into employee (name, birthday, email) values ('Casey Pawsey', '2021-04-11', '[email protected]');
insert into employee (name, birthday, email) values ('Leelah Roseblade', '2021-06-11', '[email protected]');
insert into employee (name, birthday, email) values ('Stephie Notman', '2022-01-29', '[email protected]');
insert into employee (name, birthday, email) values ('Dawna Rodenhurst', '2021-11-05', '[email protected]');
insert into employee (name, birthday, email) values ('Appolonia Blyden', '2022-03-02', '[email protected]');
insert into employee (name, birthday, email) values ('Merola Hyde', '2022-01-22', '[email protected]');
insert into employee (name, birthday, email) values ('Isidora Dadds', '2021-09-10', '[email protected]');
insert into employee (name, birthday, email) values ('Darnall Bosson', '2022-01-22', '[email protected]');
insert into employee (name, birthday, email) values ('Tuesday Whelpton', '2021-04-18', '[email protected]');
insert into employee (name, birthday, email) values ('Farica Tukely', '2021-04-15', '[email protected]');
insert into employee (name, birthday, email) values ('Shir Kinworthy', '2021-11-21', '[email protected]');
insert into employee (name, birthday, email) values ('Tabina Nipper', '2021-11-15', '[email protected]');
insert into employee (name, birthday, email) values ('Carlina Whithalgh', '2022-03-05', '[email protected]');
insert into employee (name, birthday, email) values ('Meaghan Lequeux', '2021-11-14', '[email protected]');
insert into employee (name, birthday, email) values ('Arturo Kneal', '2021-05-25', '[email protected]');
insert into employee (name, birthday, email) values ('Annecorinne Tchir', '2021-03-11', '[email protected]');
insert into employee (name, birthday, email) values ('Brynn Sumers', '2021-07-01', '[email protected]');

3-Sütunların her birine göre diğer sütunları güncelleyecek 5 adet UPDATE işlemi yapalım.

UPDATE employee
SET name = 'Anna Marie',
birthday = 2021-03-02,
WHERE id = 50;

UPDATE employee
SET email = '[email protected]',
WHERE id = 49;

UPDATE employee
SET name = 'Ahmet Mehmet',
WHERE id= 23;

UPDATE employee
SET birthday = 2021-09-28,
WHERE id = 13;

UPDATE employee
SET name = 'Arturo Romano'
WHERE id = 41;

4- Sütunların her birine göre ilgili satırı silecek 5 adet DELETE işlemi yapalım.

DELETE FROM employee
WHERE id = 14
RETURNING *;

DELETE FROM employee
WHERE name = 'Darnall Bosson'
RETURNING *;

DELETE FROM employee
WHERE birthday = 2021-10-15
RETURNING *;

DELETE FROM employee
WHERE id = 2
RETURNING *;

DELETE FROM employee
WHERE name = 'Kean Esterbrook'
RETURNING *;

sql_assignment8's People

Contributors

kucukevrem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.