SQL Database for related family members
I am curious what you think is the best way to get this MySQL database to work.
i had this table:
And thought it wouldnt be a problem to connect related family members together in 1 query like this:
id | name | related
1 | Name1 |
2 | Name2 | 3,5
3 | Name3 |
4 | Name4 |
5 | Name5 | 4,1
6 | Name6 |
7 | Name7 |
8 | Name8 | 6
9 | Name9 | 7
So Name2 is related to Name3 and Name5, where Name5 have other related id's, so i should make a query to get the following id's:
Selecting id 2, outputs related id's: 3,5,4,1
Selecting id 6, outputs related id's: 8
Selecting id 9, outputs related id's: 7
But i cant find a query to get all the related id's in one column.
Is it even possible?
How to return MS SQL server Database Status
I have a database setup to register members for a members only area of a site. I can echo all of the registered members with a checkbox so that I can choose to delete an individual member from an admi
The using statement automatically execute the Dispose method contained in IDisposable, database related classes (like SqlConnection, SqlCommand, etc) implement this interface. So if I going to use thi
I am currently doing a SQL assignment but a certain task has mentioned that we need to implement validation and verification for our tables in the database which we created. However we did not learn a
I created a new SQL Database Server in Azure SQL. Why is it not possible to create a new Premium Edition database? The button is not available.
I am creating a forum page for which i have created following database schema: Forum(questionId, postedByUserId, questionSubject, questionBody, TagIds); Tags(tagId, tagName); Entries in Forum will be
I understand that to access a SQL database from Android I need to create a web service that will run on the SQL server and will process requests from the Android application, what I need to know is ho
I'm currently in the process of adapting an existing iOS app into what will be a family of very similar apps (each app instance will probably map to a different country/region). I'm planning on having
What's the best way to move a normal SQL server database to SQL Azure? Is it right that you can't restore from a backup file? The only way I've found so far is to script the database (and it's data) a
I'm struggling to find a query which will return members who aren't friends of a certain member. Here is the layout of my tables: member_login: MemberID, email, password member_info: memberID, first_
My problem is only remote. My problem is that in the States Controller, a Country does not exist in the database. But on remote if I rails c, Country works. Country's relationship with States works. V
I'm thinking about a database design that will have two tables Members and Groups. Each member will belong to at least one group - but members might have several groups. Is the best way to reflect thi
I have created program that uses SQL Server database to store data. After a while (and lots of stored data) I have realized I don't need database on the server, local database running without server c
I have C#.Net winform application having SQL Server Database in SQLExpress with Windows Authentication. There is a Option related to Backup and restore batabase. In DBbackup i have provided user to se
i would like to develop a django management app for a small gym. we have a list of members each member could have 1 or more card each card could have 1 or more workout each workout could have 1 or mor
I am trying to write code to delete a transaction from an SQL database. The function below adds a deposit and another deletes it from the SQL database. When I try running it, it leads to an SQLLiteExc
I want to secure my SQL Server Database so that no one could open it or access programatically without a password. How can I do it? I tried the security section of SQL Server Management Express but it
So I'm working on an SQL problem, in which I have a bars and beer database from which I want to: list all bars which serve a beer that Mike likes, and which are frequented by more than one drinker. Th
I want to design a schema of my SQL database in Visio But the default database is Microsoft Access, and some datatypes do not exist there (such as tinyint). How can i change the database type to SQL ?
I had a corrupted database on my development environment that I could not access any more - probably due to a system crash. As I could not DROP the database (I can't remember why - doesnt matter any m
I'm fairly new to SQL Server. I'm trying to bulk insert into a table, using the command in SQL Server Management Studio (2005): BULK INSERT Table1 FROM 'c:\text.txt' WITH (FIELDTERMINATOR = '|') I ge
If I have a instance of an object, can I get the ID of a related object without needing to access the database? The value must be storred somewhere. eg book = Book.objects.get(id=1) book.author.id
iv created a database with some tables and populated them using SQL server 2008, i want to move the database to another machine, what would be the best way copy the database and recreate it in another
I want to write unit tests with NUnit that hit the database. I'd like to have the database in a consistent state for each test. I thought transactions would allow me to undo each test so I searched
Small introduction: I've tried to develop my project with sql database, entity framework, linq. I have table 'Users' and for example i have list of user educations. I ask myself: 'How much educations
Is it possible to use all features of Linq to SQL for a MySQL database?
Is there any way to dump the System related parameters like CPU Usage, Memory Usage etc. in SQL server database through sql query or stored procedure itself? I want to dump these system related parame
I have SQL Server 2008 installed on Windows 2008 Server. I've disabled built-in administrator password and created sa with sysadmin privileges. Question is: Is there any way to access to database, or
In Visual Basic 2010 Express, I use SQL statements to read, write, edit, ... a mdb database file. However, at the moment, it's pointing to a location on my local directory. Is there a way to embed the
I am using SQL Server 2008 Enterprise. I want to know how many different ways or different reasons why database (not instance, not server, but database) is stopped/started. I am analyzing SQL Server l
Have the following tables: Clients (ID, LastName) Orders (ID, ClientID) Payments (ID, OrderID, PaymentDate, Amount) I need a SQL query that will return the list of client LastNames that have made pa
I am planning to move my access database to sql server using SSMA. I have a Column called Eligibilty which have drop down list values as shown in Image. After Converting to sql I realized it doesn't h
I am trying to create a Family Tree website (for personal use) using MVC3 and SQL Server 2008 however I am relativly new to MVC3 (Using Razor & Entity Framework) but know SQL Server quite well. I
I have a SQL Server database and want to migrate it to a SQL Compact database. How do I do that? Thnx for help.
I am using Chrome on Windows XP and just wondering what the folder contains the Web SQL database files? I have used the Chrome Developer tool to examine the databases while I was still curious about t
I am trying to implement an update statement using a prepared statement in a PHP script, but it appears that it is not updating the record in the database and I am not sure why and so would appreciate
How to insert $ symbol in the sql database in android? When i'm trying to insert the $ and ' symbols. it gives the errors as follows, 02-18 00:39:39.821: E/AndroidRuntime(946): android.database.sqlite
I am newbie to database and SQL Server. So when i have search things about database on internet i have found that The Database said to be good if it obey or follow the ACID (Atomicity, Consistency, Is
Hello Currently I am working on a project in which I have to create family tree. It will have almostn number of hierarchy. Whole tree should be displayed to user as well as zoom in zoom out facility s
I have created a SSRS report (SQL Server 2005), however on running it I receive an error that a view doesn't exist on the mirrored database (I haven't dealt with mirroring before). What happens is I r
I have a database that is on a SQL 2000 server, and I would like to make it a Sql 2005 express edition database. What is needed to do in order to make that work? /M
I'm converting a database from Excel onto MS SQL server and am basically clueless. The Excel file has column headings of GroupID, Name, Members, Remarks The SQL table has the same fields. When I upda
I am having trouble with a SQL join question. I have a table EMPLOYEE with EmpID, FirstName, LastName, Email, Phone I have another table OTHERNAME with 2 fields Name & OtherName. This table co
I'm using the following t-sql code: USE [my_database] SELECT DISTINCT so.name FROM syscomments sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.TEXT LIKE '%table_name%' in order to show all the St
I'm caching the result of my linq 2 sql queries and I was hopeful that the related entities were also loaded and cached in the memory of my application(asp.net application). Well this did not happen.
There is an old SQL Server database which needed to be upgraded to much improved version of database schema. Mostly new columns have been added to existing tables. It is necessary to keep original dat
How to Transfer Foxpro Database To SQL Server ?
My sql server marked one database as suspected , on checking i found my mdf,ldf files are missing, but no errors on chkdsk, what it means some virus ?
I'm designing a reporting solution which uses SQL Server 2008 R2 as its backend database. The database schema is fairly simple. One table named Calls with CallId PK and one table named Events which ha
I am implementing a database design that has a vehicle table, vehicle engine and vehicle gear table with SQL 2005. Each table has an ID that is a SQL identity number, and each engine and gear has a re