Click here to Skip to main content
15,890,741 members
Home / Discussions / Database
   

Database

 
GeneralRe: What database to choose Pin
cdpace23-Dec-09 10:55
cdpace23-Dec-09 10:55 
AnswerSupport Multiple Databases Pin
David Mujica23-Dec-09 5:58
David Mujica23-Dec-09 5:58 
GeneralRe: Support Multiple Databases Pin
cdpace23-Dec-09 10:54
cdpace23-Dec-09 10:54 
Questionsqlite Pin
jashimu23-Dec-09 3:34
jashimu23-Dec-09 3:34 
AnswerRe: sqlite Pin
dxlee23-Dec-09 4:17
dxlee23-Dec-09 4:17 
GeneralRe: sqlite Pin
jashimu23-Dec-09 4:34
jashimu23-Dec-09 4:34 
GeneralRe: sqlite Pin
dxlee23-Dec-09 5:38
dxlee23-Dec-09 5:38 
Question2 SQL quesions: address book Pin
Dmitry Khudorozhkov22-Dec-09 10:27
Dmitry Khudorozhkov22-Dec-09 10:27 
Hi everyone,

this question may seem dumb, so sorry beforehand - I'm just starting to learn SQL Smile | :)

I want users to be have the address book (set of name/e-mail pairs) in my web application. To do this, I've created a db with 2 tables:

/* User info: */

CREATE TABLE `users`
(
`id` integer (12) NOT NULL AUTO_INCREMENT,
`name` varchar (50) UNIQUE NOT NULL,
`email` varchar (100) NOT NULL,
`password` varchar (50) NOT NULL, /* md5 of password */
PRIMARY KEY (`id`)
)
CHARACTER SET utf8 COLLATE utf8_general_ci;

/* Table with address info: */

CREATE TABLE `addresses`
(
`name` varchar (50) NOT NULL,
`email` varchar (100) NOT NULL,
`userid` integer (12) NOT NULL /* id of user (from the 1st table) that stored this record */
)
CHARACTER SET utf8 COLLATE utf8_general_ci;


First question: is this a good db structure?

Second question: what SQL query (join?) I must perform for user with name "name" to retrieve all his address records?

Thank you in advance.

Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).

AnswerRe: 2 SQL quesions: address book Pin
Mycroft Holmes22-Dec-09 12:10
professionalMycroft Holmes22-Dec-09 12:10 
GeneralRe: 2 SQL quesions: address book Pin
Dmitry Khudorozhkov22-Dec-09 13:17
Dmitry Khudorozhkov22-Dec-09 13:17 
QuestionQuery to Test for SA [modified] Pin
mobius11100122-Dec-09 7:30
mobius11100122-Dec-09 7:30 
AnswerRe: Query to Test for SA Pin
Dr.Walt Fair, PE22-Dec-09 7:47
professionalDr.Walt Fair, PE22-Dec-09 7:47 
GeneralRe: Query to Test for SA Pin
mobius11100122-Dec-09 7:52
mobius11100122-Dec-09 7:52 
AnswerRe: Query to Test for SA Pin
Giorgi Dalakishvili22-Dec-09 7:53
mentorGiorgi Dalakishvili22-Dec-09 7:53 
GeneralRe: Query to Test for SA Pin
Luc Pattyn22-Dec-09 8:23
sitebuilderLuc Pattyn22-Dec-09 8:23 
AnswerRe: Query to Test for SA PinPopular
mobius11100122-Dec-09 7:58
mobius11100122-Dec-09 7:58 
QuestionHow to store IList<string> in sql server</string> Pin
GauravKP22-Dec-09 5:25
professionalGauravKP22-Dec-09 5:25 
AnswerRe: How to store IList in sql server Pin
J4amieC22-Dec-09 5:34
J4amieC22-Dec-09 5:34 
AnswerRe: How to store IList in sql server Pin
Jordon4Kraftd23-Dec-09 10:03
Jordon4Kraftd23-Dec-09 10:03 
QuestionSQL Server Connect Test Pin
mobius11100122-Dec-09 4:43
mobius11100122-Dec-09 4:43 
AnswerRe: SQL Server Connect Test Pin
David Mujica22-Dec-09 5:27
David Mujica22-Dec-09 5:27 
QuestionMerge Replication Problem Pin
Jay Royall21-Dec-09 23:05
Jay Royall21-Dec-09 23:05 
AnswerRe: Merge Replication Problem Pin
Jay Royall23-Dec-09 1:59
Jay Royall23-Dec-09 1:59 
QuestionQuery Pin
sarang_k21-Dec-09 22:04
sarang_k21-Dec-09 22:04 
AnswerRe: Query Pin
Blue_Boy21-Dec-09 22:33
Blue_Boy21-Dec-09 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.