Výpis ad-hoc SQL dotazů:

#1 - uzivatele s casem vlozeni a s jejich pravama
SELECT bn_user_registrations.reg_regtime AS "Cas registrace", bn_users.usr_login AS "Login", bn_rights.prv_label AS "Prava"
FROM bn_users, bn_rights, bn_user_registrations
WHERE bn_users.usr_prv_id=bn_rights.prv_id AND bn_user_registrations.reg_new_usr_id=bn_users.usr_id
ORDER BY bn_users.usr_login;

Výsledek:


#2 - sekce s jejich autory
SELECT bn_sections.sec_name AS "Jmeno rubriky", bn_sections.sec_desc AS "Popis rubriky", bn_users.usr_login AS "Login"
FROM bn_users, bn_sections
WHERE bn_users.usr_id=bn_sections.sec_usr_id
ORDER BY bn_sections.sec_name;

Výsledek:


#3 - uzivatele kteri jsou zapsani v sekci 'Java' s pravama
SELECT bn_users.usr_login AS "Login", bn_rights.prv_label AS "Prava", bn_sections.sec_name AS "Nazev rubriky"
FROM bn_sections_privs, bn_users, bn_rights, bn_sections
WHERE bn_sections.sec_name='Java'
AND bn_sections_privs.sec_id=bn_sections.sec_id
AND bn_sections_privs.usr_id=bn_users.usr_id
AND bn_users.usr_prv_id=bn_rights.prv_id
ORDER BY bn_users.usr_login ASC;

Výsledek:


#4 - zpravy
SELECT bn_messages.msg_sendtime AS "Cas poslani", bn_users.usr_login AS "Od koho", bn_messages.msg_message AS "Zprava"
FROM bn_users, bn_messages
WHERE bn_users.usr_id=bn_messages.msg_from_usr_id
ORDER BY bn_messages.msg_sendtime DESC;

Výsledek:


#5 - administratori
SELECT bn_users.usr_login AS "Login admina"
FROM bn_users
WHERE bn_users.usr_prv_id='1';

Výsledek:


#6 - publikovane clanky, ale ne autora 'Jirka'
SELECT bn_projects.proj_name AS "Nazev projektu", bn_users.usr_login AS "Autor projektu"
FROM bn_projects, bn_users
WHERE bn_projects.proj_pubtime>'0'
AND bn_users.usr_id=bn_projects.proj_user_id
AND bn_users.usr_login<>'Jirka';

Výsledek:


#7 - autori kteri napsali nejake clanky
SELECT DISTINCT bn_users.usr_login AS "Login"
FROM bn_projects, bn_users
WHERE bn_projects.proj_user_id=bn_users.usr_id;

Výsledek:


#8 - zpravy autora 'Jirka' a vsem
SELECT bn_messages.msg_sendtime AS "Cas poslani", bn_messages.msg_message AS "Zprava"
FROM bn_users, bn_messages
WHERE bn_users.usr_login='Jirka'
AND bn_users.usr_id=bn_messages.msg_from_usr_id
AND bn_messages.msg_to_usr_id='0';

Výsledek:


#9 - sekce ve kterych je zapsan 'Jirka'
SELECT bn_sections.sec_name AS "Nazev rubriky", bn_sections.sec_desc AS "Popis rubriky"
FROM bn_sections, bn_sections_privs, bn_users
WHERE bn_sections_privs.sec_id=bn_sections.sec_id
AND bn_sections_privs.usr_id=bn_users.usr_id
AND bn_users.usr_login='Jirka';

Výsledek:


#10 - uzivatele kteri jsou zapsani v sekci 'C/C++'
SELECT bn_users.usr_login AS "Jmeno autora"
FROM bn_sections, bn_sections_privs, bn_users
WHERE bn_sections_privs.sec_id=bn_sections.sec_id
AND bn_sections_privs.usr_id=bn_users.usr_id
AND bn_sections.sec_name='C/C++'
ORDER BY bn_users.usr_login DESC;

Výsledek: