20.08.2024

0

Like

27

Views

SQL Ödev 8

  • 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 INTEGER PRIMARY KEY,
name VARCHAR(50),
birthday DATE,
email VARCHAR(100)
);
  • Oluşturduğumuz employee tablosuna 'Mockaroo' servisini kullanarak 50 adet veri ekleyelim.
INSERT INTO employee (id, name, birthday, email) VALUES 
(1, 'John Doe', '1985-04-23', '[email protected]'),
(2, 'Jane Smith', '1990-07-15', '[email protected]'),
-- devamı bu şekilde 50 satır olacak şekilde eklenir
(50, 'Alice Johnson', '1978-11-30', '[email protected]');
  • Sütunların her birine göre diğer sütunları güncelleyecek 5 adet UPDATE işlemi yapalım.
UPDATE employee SET name = 'Michael Brown' WHERE id = 2;
UPDATE employee SET birthday = '2000-12-12' WHERE email = '[email protected]';
UPDATE employee SET name = 'Updated Name' WHERE birthday = '1985-04-23';
UPDATE employee SET birthday = '1992-01-01' WHERE name = 'Jane Smith';
UPDATE employee SET email = '[email protected]' WHERE id = 1;
  • Sütunların her birine göre ilgili satırı silecek 5 adet DELETE işlemi yapalım.
DELETE FROM employee WHERE id = 3;
DELETE FROM employee WHERE name = 'Jane Smith';
DELETE FROM employee WHERE birthday = '1992-01-01';
DELETE FROM employee WHERE email = '[email protected]';
DELETE FROM employee WHERE id BETWEEN 10 AND 15;


SQL

Comments

You need to log in to be able to comment!

Kenan Ayberk Özkan

I’m looking for places where I can use my interest in software or design, improve my existing skills and myself, especially add new talents to shape my business life.

Location

Elazığ, TR

Education

Elektrik - Elektronik Mühendisliği - Fırat Üniversitesi

Job Experience

INTERN - EÜAŞ KEBAN DAM

INTERN R&D - MOSAŞ GROUP

INTERN EMBEDDED SYSTEMS - PAVOTEK

© 2021 Patika Dev

facebook
twitter
instagram
youtube
linkedin

Disclaimer: The information /programs / events provided on https://patika.dev and https://risein.com are strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice and do not make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://patika.dev and https://risein.com disclaim any responsibility for financial decisions made by users based on information provided here.