SQL(?) kullanarak basit bir database(veritabanı) yaratmak

phalanx88

New member
Katılım
15 Kas 2006
Mesajlar
293
Reaction score
0
Puanları
0
merhaba hackhell kulanıcıları.benim bi maruzatım olacak yine anlayan arkdasşlara, başımda bi ödev varki sormayın.gecen gunde bir C projesı ıcın yardım almak ıstemıstım gerçi ama onu hallettmeye calısmıstım kendı basıma.bunun hakkında ise hiçbişe bilmiorum.ben yine ödev konusunu ingilizce yayınlayacam.SQL den falan bahsedıo.derslere pek gıtmedım bişe bılmıyorum ama soyle bı tahmın edersem SQL yardımı ile falan ufak bi veri tabanı olusturmamızı ıstıyorlar.işin garip tarafı bu odev el yazısyıla verılecek.cumlelerden sekıllerden olusan bı veritabanı istiyolar sanırım.olaydan anlayan ama turkcesı lazım dıyen varsa cevırmeye calısıp onu da koyarım ama basıt ıngılızce kullanılmıs zaten acıklarken ,umarım bir çare bulunur.

In this homework you are expected to design a database for students at Bogaziçi University. Assume that the database is going to be used by registration office, advisors and students to manage and query course registrations and by the library to manage book borrowings.

To do list:
1. Build a data dictionary for the database.
2. Draw the entity-relationship diagrams for the database.
3. Describe the tables you will create and the SQL statements for creating these tables.
4. For each of the following questions, give the SQL statement that will return the answer:
a. Which students take the course titled ISE 100 in the fall 2005 semester ?
b. What is the list of books borrowed by the student with firstname X and lastname Y ?
c. For how many days has the student with with firstname X and lastname Y kept the book titled ‘Discrete Mathematics’ ?
d. Which courses do the students who borrowed the books titled ‘Discrete Mathematics’ take ?
e. What are the email addresses of the students who are taking ISE 100 ?
f. Which students have date of birth year between 1985 and 1990 ?
 
sewgılı kardesım once werı tabanı programı mysqL kulanacaksaın ;)
bu aten wındsoun ıcın de war son ra ıse kod takımı su:

#include <mysql/mysql.h>
#include <stdio.h>

int main(){
MYSQL *mysql;
MYSQL_RES *res;
MYSQL_ROW row;
char *query;
int t,r;

mysql_init(mysql);
if (!mysql_real_connect(mysql,"localhost","root",
"mysql","mesut",0,NULL,0))
{printf( "Error connectin ot database: %s\n",mysql_error(mysql));
}
else printf("Connected...\n");

query="select * from yakalanan ";
t=mysql_real_query(mysql,query,(unsigned int) strlen(query));
if (t)
{
printf("Error making query: %s\n",
mysql_error(mysql));
}
else printf("Query made...\n");
res=mysql_use_result(mysql);
for(r=0;r<=mysql_field_count(mysql);r++){
row=mysql_fetch_row(res);
if(row<0) break;
for(t=0;t<mysql_num_fields(res);t++){
printf("%s ",row[t]);
}
printf("\n");
}
mysql_close(mysql);
}
......................................................
calıstırdıktan sorasıda sole
[root@localhost root]# gcc deneme.c -o gll -lmysqlclient -L/usr/lib/mysql
[root@localhost root]# ./gll
Connected...
Query made...
25 apr 22 22.22.22
125 ap 30 22.22.22
33 ap 30 22.22.11
55 jly 30 22.22.11
25 30 22.22.11
125 jly 30 22.22.11
Segmentation fault




bunu ben yapmadım ark yapılmısı warmıs bıde su sorguyu gonderdı.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mysql/mysql.h>


int main()

MYSQL *mysql;
MYSQL_RES *res;
MYSQL_ROW row;
char *query;
int t,r;

mysql_init(mysql);
if (!mysql_real_connect(mysql,"localhost","root",
"mysql","mesut",0,NULL,0))
{
printf( "Error connectin ot database: %s\n",mysql_error(mysql));
}
else printf("Connected...\n");



query="INSERT INTO yakalanan Values ('1111','3.33.3.3','33.33.33.33','udp','15 may 22.22.10') ";

/* query="Select * From yakalanan";*/

t=mysql_real_query(mysql,query,(unsigned int) strlen(query));


if (t) {
printf("Error making query: %s\n",
mysql_error(mysql));
}
else printf("Query made...\n");
res=mysql_store_result(mysql);

printf("%d rows returned from the quesry\n",mysql_num_rows(res));


for(r=0;r<mysql_field_count(mysql);r++){
row=mysql_fetch_row(res);

if(row<0) break;

while((row = mysql_fetch_row(res)) != NULL ) {
printf(" %s %s %s %s %s\n", row[0], row[1],row[2],row[3],row[4]);
}
}
mysql_close(mysql);
}


kolay geLsın .İİ FromLar.




bıde

Aşağıdaki sql ifadesini c++ kodundan çalıştırarak yedekleme yapabilirsin.

"BACKUP DATABASE veritabani_adi
FILE = dosya_adi TO DISK = 'backup_alinacak_dosya_pathi'"

borland c++ builder 6 ve MYSQL de hiç böyle bir şey denemedim ama visual c++ 6.0 ve MS SQL de söylediğim yapılabiliyor.
 
Hocam bi de PLSQL komut cümleleri ve Türkçe karşılıkları sizde varmı.Herkeze yardımcı oluyorsunuz birde bana yardım ederseniz çok sevinirim
 
saolun tekrar da yoldaş isimli arkdsşm verdiğin şeyi tam olarak nasıl kullanıcam neye yarar
 
kullanımı çok basit

PHP tabanlı mysql arayüzü

veri tabanı oluştur diyorsun oluşturuyor

eğer çok istersen yardım etmemi

profilimde msn adresim var ;)
 
Geri
Üst