This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from "react"; | |
import { | |
QueryClient, | |
QueryClientProvider, | |
useQuery, | |
} from "@tanstack/react-query"; | |
const queryClient = new QueryClient(); | |
export default function Pictures() { | |
const [pictures, setPictures] = useState(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
table { | |
border-collapse: collapse; | |
} | |
td, th { | |
border: black solid 2px; | |
padding: 5px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1 | |
SELECT CASE WHEN EXISTS ( SELECT * FROM user_details GROUP BY username HAVING COUNT(*) > 1 ) THEN 'tak' ELSE 'nie' END AS czy_istnieja_duplikaty; | |
-- 2 | |
SELECT COUNT(user_id) AS liczba, first_name FROM `user_details` GROUP BY first_name ORDER BY `liczba` DESC; | |
-- 3 | |
SELECT COUNT(user_id) AS liczba, last_name FROM `user_details` GROUP BY last_name ORDER BY liczba DESC; | |
-- 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO role (id, app_name, name) VALUES (1, 0, "Driver"); | |
INSERT INTO role (id, app_name, name) VALUES (2, 3, "Driver"); | |
INSERT INTO role (id, app_name, name) VALUES (3, 0, "Delivery man"); | |
INSERT INTO role (id, app_name, name) VALUES (4, 3, "Delivery man"); | |
INSERT INTO role (id, app_name, name) VALUES (5, 0, "Forwarding agent"); | |
INSERT INTO role (id, app_name, name) VALUES (6, 3, "Forwarding agent"); | |
INSERT INTO role (id, app_name, name) VALUES (7, 4, "Warehouse worker"); | |
INSERT INTO role (id, app_name, name) VALUES (8, 3, "Warehouse worker"); | |
INSERT INTO role (id, app_name, name) VALUES (9, 4, "Warehouse manager"); | |
INSERT INTO role (id, app_name, name) VALUES (10, 3, "Warehouse manager"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Zadanie 3 | |
ALTER TABLE `BD15`.`panstwa` ADD PRIMARY KEY (`id`); | |
ALTER TABLE `stolice` ADD PRIMARY KEY(`id`); | |
ALTER TABLE `stolice` ADD FOREIGN KEY (`id_panstwa`) REFERENCES `panstwa`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; | |
-- Zadanie 4 | |
-- a | |
SELECT `powierzchnia`, `ludnosc`, stolice.stolica FROM `panstwa` JOIN stolice ON stolice.id_panstwa = panstwa.id WHERE panstwa.panstwo = "polska"; | |
-- b | |
SELECT COUNT(0) FROM `bd15`.`panstwa` WHERE `bd15`.`panstwa`.`panstwo` LIKE 'p%'; | |
--c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student | |
{ | |
public Age :number | |
public Name :string | |
constructor(age :number, name :string) { | |
this.Age = age | |
this.Name = name | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- zadanie 1 | |
CREATE TABLE `zatrudnienie`.`stanowiska` | |
(`id_pracownika` INT NOT NULL AUTO_INCREMENT , | |
`stanowisko` VARCHAR(40) NOT NULL , | |
`numer_pokoju` INT NOT NULL , | |
`data_stanowisko` DATETIME NULL , | |
`data_mod_stanowisko` DATETIME NULL , | |
PRIMARY KEY (`id_pracownika`)); | |
-- zadanie 2 | |
INSERT INTO `stanowiska` (`id_pracownika`, `stanowisko`, `numer_pokoju`, `data_stanowisko`, `data_mod_stanowisko`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--1 | |
SELECT COUNT(*) FROM imiona; | |
--2 | |
SELECT COUNT(DISTINCT imie) FROM imiona; | |
--3 | |
SELECT imie, COUNT(imie) FROM imiona GROUP BY imie; | |
--4 | |
SELECT COUNT(imie) FROM imiona WHERE LENGTH(imie) = 5; | |
--5 | |
SELECT COUNT(imie) AS "Liczba imion", LENGTH(imie) AS "Liczba liter" FROM imiona GROUP BY LENGTH(imie); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--3a | |
SELECT `rocznik`, COUNT(*) AS LiczbaSamochodow | |
FROM dane | |
GROUP BY `rocznik` | |
HAVING LiczbaSamochodow = (SELECT MAX(cnt) FROM | |
(SELECT `rocznik`, COUNT(*) AS cnt FROM dane GROUP BY `rocznik`) AS subquery); | |
--3b | |
SELECT dane.`nr_rej`, dane.marka, dane.model , `wartoscpocz` - `cenat` AS "in PLN" , | |
CONCAT(MAX(ROUND(((`wartoscpocz`-`cenat`)/`wartoscpocz`)*100, 2)), '%') AS "Percent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
import re | |
import unicodedata | |
from math import sin, cos, pi | |
import matplotlib.pyplot as plt | |
import numpy as np | |
PATH = "gromady.xlsx" | |
data = pandas.read_excel(PATH) |
NewerOlder